[SOLVED 6.0.4] how to link abinit to Vsim?

External optional components of Abinit (BigDFT, Wannier90, ...) and codes using / providing data from / to Abinit (AtomPAW, EXC, DP, SAX, WanT, Yambo, ...).

Moderator: rangel

[SOLVED 6.0.4] how to link abinit to Vsim?

Postby hhwj340 » Mon Jan 04, 2010 11:50 am

Hey, i want to link abinit to Vsim.
i don't know how to do?
Can someone tell me how to do?
thanks!
hhwj340
hhwj340
 
Posts: 20
Joined: Mon Jan 04, 2010 11:42 am

Re: how to link abinit to Vsim?

Postby dcaliste » Thu Feb 18, 2010 4:56 pm

Hello,

Sorry for very late answering, I'm not reading the forum...

To have V_Sim reading ABINIT input file, you need:
- ABINIT 5.7.x and V_Sim 3.4.x, or ;
- ABINIT 5.8.x and V_Sim 3.5.x.

When you compile ABINIT, use --enable-bindings during configure stage. Depending on your compiler, you'll have also to change the #define in bindings/parser/ab6_invars_c.c. Using gfortran 4.2 is fine. For later versions or with ifort, FC_MOD_NAME need modifications.

Then, in this directory, you'll have a libabinis.a and some headers. A make install should put them in proper directory. For the example, let say that it puts the lib in $ABINIT/lib and the headers in $ABINIT/include.

In V_Sim now, during configure time, set --with-abinit=$ABINIT (same value than before). You should see at the end of configure that abinit option is indeed set to yes. If not, you'll have to look in the config.log to see what is wrong.

Don't hesitate to ask question here now, I've suscribe the RSS feed.
dcaliste
 
Posts: 44
Joined: Thu Oct 22, 2009 9:15 am

Re: how to link abinit to Vsim?

Postby maurosgroi » Wed Apr 07, 2010 12:19 pm

Dear dcaliste,
I followed your instructions with abinit 6.03 and v_sim 3.5.1 but the bindings seem to not work.
I get the following error in the config.log file of v_sim:

configure:26695: gcc -o conftest -O2 -Wall -W -ansi -Wno-error conftest.c -L/opt/abinit-6.0.3/lib -labinis -L/usr/lib/gcc/x86_64-linux-gnu/4.4.3 -L/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib -L/lib/../lib -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../.. -lgfortranbegin -lgfortran -lm >&5
conftest.c: In function 'main':
conftest.c:13: warning: implicit declaration of function 'ab6_invars_new_from_file'
conftest.c:11: warning: unused parameter 'argc'
conftest.c:11: warning: unused parameter 'argv'
/opt/abinit-6.0.3/lib/libabinis.a(ab6_invars_c.o): In function `ab6_invars_get_real_array':
/opt/src/abinit-6.0.3/bindings/parser/ab6_invars_c.c:126: undefined reference to `__ab6_invars__ab6_invars_get_real_array'
/opt/abinit-6.0.3/lib/libabinis.a(ab6_invars_c.o): In function `ab6_invars_get_integer_array':
/opt/src/abinit-6.0.3/bindings/parser/ab6_invars_c.c:117: undefined reference to `__ab6_invars__ab6_invars_get_integer_array'
/opt/abinit-6.0.3/lib/libabinis.a(ab6_invars_c.o): In function `ab6_invars_get_shape':
/opt/src/abinit-6.0.3/bindings/parser/ab6_invars_c.c:108: undefined reference to `__ab6_invars__ab6_invars_get_shape'
/opt/abinit-6.0.3/lib/libabinis.a(ab6_invars_c.o): In function `ab6_invars_get_real':
/opt/src/abinit-6.0.3/bindings/parser/ab6_invars_c.c:100: undefined reference to `__ab6_invars__ab6_invars_get_real'
/opt/abinit-6.0.3/lib/libabinis.a(ab6_invars_c.o): In function `ab6_invars_get_integer':
/opt/src/abinit-6.0.3/bindings/parser/ab6_invars_c.c:91: undefined reference to `__ab6_invars__ab6_invars_get_integer'
/opt/abinit-6.0.3/lib/libabinis.a(ab6_invars_c.o): In function `ab6_invars_get_ndtset':
/opt/src/abinit-6.0.3/bindings/parser/ab6_invars_c.c:82: undefined reference to `__ab6_invars__ab6_invars_get_ndtset'
/opt/abinit-6.0.3/lib/libabinis.a(ab6_invars_c.o): In function `ab6_invars_free':
/opt/src/abinit-6.0.3/bindings/parser/ab6_invars_c.c:74: undefined reference to `__ab6_invars__ab6_invars_free'
/opt/abinit-6.0.3/lib/libabinis.a(ab6_invars_c.o): In function `ab6_invars_new_from_string':
/opt/src/abinit-6.0.3/bindings/parser/ab6_invars_c.c:61: undefined reference to `__ab6_invars__ab6_invars_new_from_string'
/opt/abinit-6.0.3/lib/libabinis.a(ab6_invars_c.o): In function `ab6_invars_new_from_file':
/opt/src/abinit-6.0.3/bindings/parser/ab6_invars_c.c:44: undefined reference to `__ab6_invars__ab6_invars_new_from_file'
collect2: ld returned 1 exit status

I get a similar undefined reference error trying to check the bindings in the parser directory with: make -f parser.mk check.
So I think that the problem could be related to abinit.
Thanks a lot in advance and best regards,
Mauro Sgroi.
maurosgroi
 
Posts: 27
Joined: Wed Apr 07, 2010 12:12 pm

Re: how to link abinit to Vsim?

Postby dcaliste » Fri Apr 09, 2010 9:52 am

Hello,

Thanks for giving the log informations.

maurosgroi wrote:/opt/abinit-6.0.3/lib/libabinis.a(ab6_invars_c.o): In function `ab6_invars_get_real_array':
/opt/src/abinit-6.0.3/bindings/parser/ab6_invars_c.c:126: undefined reference to `__ab6_invars__ab6_invars_get_real_array'


I guess that you're using a version of GFortran greater than 4.2. There is no official support currently in the Autotools for Fortran modules and we thus need to do it by hand in ABINIT. The current code in ABINIT has been written for Gfortran 4.2, but this compiler changed its naming scheme of modules between version 4.2 and 4.3. To solve this, edit the file $ABINIT/bindings/parser/ab6_invars_c.c line 8:
#define FC_MOD_NAME(M,A) __ ## M ## __ ## A
should become #define FC_MOD_NAME(M,A) __ ## M ## _MOD_ ## A
This can be done also in ab6_symmetry_c.c.
Then issue make again in the bindings/parser directory, and then a make install.

Try again the configure of V_Sim, it may work.
dcaliste
 
Posts: 44
Joined: Thu Oct 22, 2009 9:15 am

Re: how to link abinit to Vsim?

Postby maurosgroi » Fri Apr 09, 2010 1:55 pm

dcaliste wrote:Hello,

Thanks for giving the log informations.

maurosgroi wrote:/opt/abinit-6.0.3/lib/libabinis.a(ab6_invars_c.o): In function `ab6_invars_get_real_array':
/opt/src/abinit-6.0.3/bindings/parser/ab6_invars_c.c:126: undefined reference to `__ab6_invars__ab6_invars_get_real_array'


I guess that you're using a version of GFortran greater than 4.2. There is no official support currently in the Autotools for Fortran modules and we thus need to do it by hand in ABINIT. The current code in ABINIT has been written for Gfortran 4.2, but this compiler changed its naming scheme of modules between version 4.2 and 4.3. To solve this, edit the file $ABINIT/bindings/parser/ab6_invars_c.c line 8:
#define FC_MOD_NAME(M,A) __ ## M ## __ ## A
should become #define FC_MOD_NAME(M,A) __ ## M ## _MOD_ ## A
This can be done also in ab6_symmetry_c.c.
Then issue make again in the bindings/parser directory, and then a make install.

Try again the configure of V_Sim, it may work.


Dear dcaliste,
thanks a lot for the information.
Now v_sim configures and compiles apparently well.
But when I execute it I get:

** (v_sim:24149): WARNING **: The plugin '/opt/v_sim-3.5.1/lib/v_sim/plug-ins/libabinit.so' is not a loadable module, error:
/opt/v_sim-3.5.1/lib/v_sim/plug-ins/libabinit.so: undefined symbol: __ab6_invars_MOD_ab6_invars_get_real_array.

** (v_sim:24149): WARNING **: failure loading plugin '/opt/v_sim-3.5.1/lib/v_sim/plug-ins/libabinit.so'!

It seems that some symbols are not exported well in libabinit.so.
Doing nm on it:

nm libabinit.so | grep __ab6_invars_MOD_ab6_invars_get_real_array

I get:
U __ab6_invars_MOD_ab6_invars_get_real_array

Thanks a lot in advance and best regards,
Mauro.
maurosgroi
 
Posts: 27
Joined: Wed Apr 07, 2010 12:12 pm

Re: how to link abinit to Vsim?

Postby dcaliste » Fri Apr 09, 2010 5:26 pm

Hello,

maurosgroi wrote:** (v_sim:24149): WARNING **: The plugin '/opt/v_sim-3.5.1/lib/v_sim/plug-ins/libabinit.so' is not a loadable module, error:
/opt/v_sim-3.5.1/lib/v_sim/plug-ins/libabinit.so: undefined symbol: __ab6_invars_MOD_ab6_invars_get_real_array.
nm libabinit.so | grep __ab6_invars_MOD_ab6_invars_get_real_array
I get:
U __ab6_invars_MOD_ab6_invars_get_real_array


After investigation, I noticed that the module ab6_invars in src/57_iovars has been renamed to m_ab6_invars to fullfill coding rules. Waiting for the official correction, you can modify the two previous files (ab6_invars_c_.c and ab6_symmetry_c.c) and change again the #define line with:
#define FC_MOD_NAME(M,A) __m_ ## M ## _MOD_ ## A

I hope it will do the job properly...

Damien.
dcaliste
 
Posts: 44
Joined: Thu Oct 22, 2009 9:15 am

Re: how to link abinit to Vsim?

Postby maurosgroi » Mon Apr 12, 2010 10:21 am

Dear dcaliste,
this is the output of the configure command (config.log). With the last modification v_sim doesn't configure with the abinit support.
I can't understand the problem.
Best regards,
Mauro.

configure:26695: gcc -o conftest -O3 -mtune=native -Wall -W -ansi -Wno-error conftest.c -L/opt/abinit-6.0.3/lib -labinis -L/usr/lib/gcc/x86_64-linux-gnu/4.4.3 -L/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib -L/lib/../lib -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../.. -lgfortranbegin -lgfortran -lm >&5
conftest.c: In function 'main':
conftest.c:13: warning: implicit declaration of function 'ab6_invars_new_from_file'
conftest.c:11: warning: unused parameter 'argc'
conftest.c:11: warning: unused parameter 'argv'
/opt/abinit-6.0.3/lib/libabinis.a(pspheads_comm.o): In function `pspheads_comm':
/opt/src/abinit-6.0.3/src/51_manage_mpi/pspheads_comm.F90:97: undefined reference to `mpi_bcast_'
/opt/src/abinit-6.0.3/src/51_manage_mpi/pspheads_comm.F90:120: undefined reference to `mpi_bcast_'
/opt/src/abinit-6.0.3/src/51_manage_mpi/pspheads_comm.F90:143: undefined reference to `mpi_bcast_'
/opt/src/abinit-6.0.3/src/51_manage_mpi/pspheads_comm.F90:157: undefined reference to `mpi_bcast_'
/opt/src/abinit-6.0.3/src/51_manage_mpi/pspheads_comm.F90:169: undefined reference to `mpi_bcast_'
/opt/abinit-6.0.3/lib/libabinis.a(leave_test.o): In function `leave_test':
/opt/src/abinit-6.0.3/src/51_manage_mpi/leave_test.F90:82: undefined reference to `mpi_barrier_'
/opt/src/abinit-6.0.3/src/51_manage_mpi/leave_test.F90:92: undefined reference to `mpi_allreduce_'
/opt/src/abinit-6.0.3/src/51_manage_mpi/leave_test.F90:98: undefined reference to `mpi_finalize_'
/opt/abinit-6.0.3/lib/libabinis.a(xmpi_me.o): In function `xmpi_me':
/opt/src/abinit-6.0.3/src/12_hide_mpi/xmpi_me.F90:60: undefined reference to `mpi_comm_rank_'
/opt/abinit-6.0.3/lib/libabinis.a(clnmpi_fft.o): In function `clnmpi_fft':
/opt/src/abinit-6.0.3/src/51_manage_mpi/clnmpi_fft.F90:74: undefined reference to `mpi_comm_free_'
/opt/src/abinit-6.0.3/src/51_manage_mpi/clnmpi_fft.F90:83: undefined reference to `mpi_comm_free_'
/opt/abinit-6.0.3/lib/libabinis.a(initmpi_fft.o): In function `initmpi_fft':
/opt/src/abinit-6.0.3/src/51_manage_mpi/initmpi_fft.F90:101: undefined reference to `mpi_comm_size_'
/opt/src/abinit-6.0.3/src/51_manage_mpi/initmpi_fft.F90:102: undefined reference to `mpi_comm_rank_'
/opt/src/abinit-6.0.3/src/51_manage_mpi/initmpi_fft.F90:117: undefined reference to `mpi_comm_group_'
/opt/src/abinit-6.0.3/src/51_manage_mpi/initmpi_fft.F90:293: undefined reference to `mpi_group_incl_'
/opt/src/abinit-6.0.3/src/51_manage_mpi/initmpi_fft.F90:294: undefined reference to `mpi_comm_create_'
/opt/src/abinit-6.0.3/src/51_manage_mpi/initmpi_fft.F90:300: undefined reference to `mpi_group_incl_'
/opt/src/abinit-6.0.3/src/51_manage_mpi/initmpi_fft.F90:130: undefined reference to `mpi_group_incl_'
/opt/src/abinit-6.0.3/src/51_manage_mpi/initmpi_fft.F90:132: undefined reference to `mpi_comm_create_'
/opt/src/abinit-6.0.3/src/51_manage_mpi/initmpi_fft.F90:136: undefined reference to `mpi_group_free_'
/opt/src/abinit-6.0.3/src/51_manage_mpi/initmpi_fft.F90:142: undefined reference to `mpi_comm_rank_'
/opt/src/abinit-6.0.3/src/51_manage_mpi/initmpi_fft.F90:149: undefined reference to `mpi_comm_size_'
/opt/src/abinit-6.0.3/src/51_manage_mpi/initmpi_fft.F90:270: undefined reference to `mpi_group_incl_'
/opt/src/abinit-6.0.3/src/51_manage_mpi/initmpi_fft.F90:273: undefined reference to `mpi_comm_create_'
/opt/src/abinit-6.0.3/src/51_manage_mpi/initmpi_fft.F90:276: undefined reference to `mpi_group_free_'
/opt/abinit-6.0.3/lib/libabinis.a(initmpi_grid.o): In function `initmpi_grid':
/opt/src/abinit-6.0.3/src/51_manage_mpi/initmpi_grid.F90:124: undefined reference to `mpi_cart_create_'
/opt/src/abinit-6.0.3/src/51_manage_mpi/initmpi_grid.F90:128: undefined reference to `mpi_comm_rank_'
/opt/src/abinit-6.0.3/src/51_manage_mpi/initmpi_grid.F90:130: undefined reference to `mpi_cart_coords_'
/opt/src/abinit-6.0.3/src/51_manage_mpi/initmpi_grid.F90:139: undefined reference to `mpi_cart_sub_'
/opt/src/abinit-6.0.3/src/51_manage_mpi/initmpi_grid.F90:145: undefined reference to `mpi_cart_sub_'
/opt/src/abinit-6.0.3/src/51_manage_mpi/initmpi_grid.F90:152: undefined reference to `mpi_cart_sub_'
/opt/src/abinit-6.0.3/src/51_manage_mpi/initmpi_grid.F90:154: undefined reference to `mpi_comm_size_'
/opt/src/abinit-6.0.3/src/51_manage_mpi/initmpi_grid.F90:156: undefined reference to `mpi_comm_size_'
/opt/src/abinit-6.0.3/src/51_manage_mpi/initmpi_grid.F90:158: undefined reference to `mpi_comm_size_'
/opt/src/abinit-6.0.3/src/51_manage_mpi/initmpi_grid.F90:166: undefined reference to `mpi_cart_sub_'
/opt/src/abinit-6.0.3/src/51_manage_mpi/initmpi_grid.F90:168: undefined reference to `mpi_comm_rank_'
/opt/abinit-6.0.3/lib/libabinis.a(m_numeric_tools.o): In function `__m_numeric_tools_MOD_llsfit_svd':
/opt/src/abinit-6.0.3/src/28_numeric_noabirule/m_numeric_tools.F90:1503: undefined reference to `dgesvd_'
collect2: ld returned 1 exit status
configure:26701: $? = 1
configure: failed program was:
|
| void wrtout_()
| {
| }
| void leave_new_()
| {
| }
| void timab_()
| {
| }
| int main(int argc, const char **argv)
| {
| ab6_invars_new_from_file();
| return 0;
| }
|
configure:26717: result: no
configure:26720: checking for symmetry capabilities in libabinis.a from /opt/abinit-6.0.3/lib
configure:26746: gcc -o conftest -O3 -mtune=native -Wall -W -ansi -Wno-error conftest.c -L/opt/abinit-6.0.3/lib -labinis -L/usr/lib/gcc/x86_64-linux-gnu/4.4.3 -L/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib -L/lib/../lib -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../.. -lgfortranbegin -lgfortran -lm >&5
conftest.c: In function 'main':
conftest.c:13: warning: implicit declaration of function 'ab6_symmetry_new'
conftest.c:11: warning: unused parameter 'argc'
conftest.c:11: warning: unused parameter 'argv'
/opt/abinit-6.0.3/lib/libabinis.a(ab6_symmetry_c.o): In function `ab6_symmetry_get_auto_k_grid':
/opt/src/abinit-6.0.3/bindings/parser/ab6_symmetry_c.c:383: undefined reference to `__m_ab6_symmetry_MOD_ab6_symmetry_binding_auto_k_1'
/opt/src/abinit-6.0.3/bindings/parser/ab6_symmetry_c.c:387: undefined reference to `__m_ab6_symmetry_MOD_ab6_symmetry_binding_auto_k_2'
/opt/abinit-6.0.3/lib/libabinis.a(ab6_symmetry_c.o): In function `ab6_symmetry_get_mp_k_grid':
/opt/src/abinit-6.0.3/bindings/parser/ab6_symmetry_c.c:366: undefined reference to `__m_ab6_symmetry_MOD_ab6_symmetry_binding_mp_k_1'
/opt/src/abinit-6.0.3/bindings/parser/ab6_symmetry_c.c:370: undefined reference to `__m_ab6_symmetry_MOD_ab6_symmetry_binding_mp_k_2'
/opt/abinit-6.0.3/lib/libabinis.a(ab6_symmetry_c.o): In function `ab6_symmetry_get_group':
/opt/src/abinit-6.0.3/bindings/parser/ab6_symmetry_c.c:305: undefined reference to `__m_ab6_symmetry_MOD_ab6_symmetry_get_group'
/opt/abinit-6.0.3/lib/libabinis.a(ab6_symmetry_c.o): In function `ab6_symmetry_get_matrices':
/opt/src/abinit-6.0.3/bindings/parser/ab6_symmetry_c.c:261: undefined reference to `__m_ab6_symmetry_MOD_ab6_symmetry_get_matrices'
/opt/abinit-6.0.3/lib/libabinis.a(ab6_symmetry_c.o): In function `ab6_symmetry_get_bravais':
/opt/src/abinit-6.0.3/bindings/parser/ab6_symmetry_c.c:222: undefined reference to `__m_ab6_symmetry_MOD_ab6_symmetry_get_bravais'
/opt/abinit-6.0.3/lib/libabinis.a(ab6_symmetry_c.o): In function `ab6_symmetry_get_multiplicity':
/opt/src/abinit-6.0.3/bindings/parser/ab6_symmetry_c.c:210: undefined reference to `__m_ab6_symmetry_MOD_ab6_symmetry_get_multiplicity'
/opt/abinit-6.0.3/lib/libabinis.a(ab6_symmetry_c.o): In function `ab6_symmetry_get_n_sym':
/opt/src/abinit-6.0.3/bindings/parser/ab6_symmetry_c.c:203: undefined reference to `__m_ab6_symmetry_MOD_ab6_symmetry_get_n_sym'
/opt/abinit-6.0.3/lib/libabinis.a(ab6_symmetry_c.o): In function `ab6_symmetry_get_equivalent_atom':
/opt/src/abinit-6.0.3/bindings/parser/ab6_symmetry_c.c:337: undefined reference to `__m_ab6_symmetry_MOD_ab6_symmetry_get_equivalent_atom'
/opt/abinit-6.0.3/lib/libabinis.a(ab6_symmetry_c.o): In function `ab6_symmetry_get_n_atoms':
/opt/src/abinit-6.0.3/bindings/parser/ab6_symmetry_c.c:196: undefined reference to `__m_ab6_symmetry_MOD_ab6_symmetry_get_n_atoms'
/opt/abinit-6.0.3/lib/libabinis.a(ab6_symmetry_c.o): In function `ab6_symmetry_set_jellium':
/opt/src/abinit-6.0.3/bindings/parser/ab6_symmetry_c.c:188: undefined reference to `__m_ab6_symmetry_MOD_ab6_symmetry_set_jellium'
/opt/abinit-6.0.3/lib/libabinis.a(ab6_symmetry_c.o): In function `ab6_symmetry_set_field':
/opt/src/abinit-6.0.3/bindings/parser/ab6_symmetry_c.c:181: undefined reference to `__m_ab6_symmetry_MOD_ab6_symmetry_set_field'
/opt/abinit-6.0.3/lib/libabinis.a(ab6_symmetry_c.o): In function `ab6_symmetry_set_spin_orbit':
/opt/src/abinit-6.0.3/bindings/parser/ab6_symmetry_c.c:174: undefined reference to `__m_ab6_symmetry_MOD_ab6_symmetry_set_spin_orbit'
/opt/abinit-6.0.3/lib/libabinis.a(ab6_symmetry_c.o): In function `ab6_symmetry_set_spin':
/opt/src/abinit-6.0.3/bindings/parser/ab6_symmetry_c.c:163: undefined reference to `__m_ab6_symmetry_MOD_ab6_symmetry_get_n_atoms'
/opt/src/abinit-6.0.3/bindings/parser/ab6_symmetry_c.c:167: undefined reference to `__m_ab6_symmetry_MOD_ab6_symmetry_set_spin'
/opt/abinit-6.0.3/lib/libabinis.a(ab6_symmetry_c.o): In function `ab6_symmetry_set_structure':
/opt/src/abinit-6.0.3/bindings/parser/ab6_symmetry_c.c:155: undefined reference to `__m_ab6_symmetry_MOD_ab6_symmetry_set_structure'
/opt/abinit-6.0.3/lib/libabinis.a(ab6_symmetry_c.o): In function `ab6_symmetry_set_lattice':
/opt/src/abinit-6.0.3/bindings/parser/ab6_symmetry_c.c:147: undefined reference to `__m_ab6_symmetry_MOD_ab6_symmetry_set_lattice'
/opt/abinit-6.0.3/lib/libabinis.a(ab6_symmetry_c.o): In function `ab6_symmetry_set_tolerance':
/opt/src/abinit-6.0.3/bindings/parser/ab6_symmetry_c.c:130: undefined reference to `__m_ab6_symmetry_MOD_ab6_symmetry_set_tolerance'
/opt/abinit-6.0.3/lib/libabinis.a(ab6_symmetry_c.o): In function `ab6_symmetry_free':
/opt/src/abinit-6.0.3/bindings/parser/ab6_symmetry_c.c:123: undefined reference to `__m_ab6_symmetry_MOD_ab6_symmetry_free'
/opt/abinit-6.0.3/lib/libabinis.a(ab6_symmetry_c.o): In function `ab6_symmetry_new':
/opt/src/abinit-6.0.3/bindings/parser/ab6_symmetry_c.c:111: undefined reference to `__m_ab6_symmetry_MOD_ab6_symmetry_new'
collect2: ld returned 1 exit status
configure:26752: $? = 1
configure: failed program was:
|
| void wrtout_()
| {
| }
| void leave_new_()
| {
| }
| void timab_()
| {
| }
| int main(int argc, const char **argv)
| {
| ab6_symmetry_new();
| return 0;
| }
maurosgroi
 
Posts: 27
Joined: Wed Apr 07, 2010 12:12 pm

Re: how to link abinit to Vsim?

Postby dcaliste » Fri Apr 16, 2010 10:00 am

Hello,

maurosgroi wrote:Dear dcaliste,
this is the output of the configure command (config.log). With the last modification v_sim doesn't configure with the abinit support.

/opt/src/abinit-6.0.3/src/51_manage_mpi/initmpi_fft.F90:101: undefined reference to `mpi_comm_size_'
/opt/src/abinit-6.0.3/src/51_manage_mpi/initmpi_fft.F90:102: undefined reference to `mpi_comm_rank_'
/opt/src/abinit-6.0.3/src/51_manage_mpi/initmpi_fft.F90:117: undefined reference to `mpi_comm_group_'

This is a more severe issue than I expected. The plugin has been tested with ABINIT up to 5.9.x, and it seems that it fails to pass the 6.x jump :(
Some of the lower levels of ABINIT has been reorganised and now depend on MPI (seem so from your logs, I must check this assertion).

I'll work on it next week in my ABINIT branch. A solution should be publicly available in the next minor revision of ABINIT.

You may have a work around waiting for the offical solution that would be to compile ABINIT without MPI support when you compile the library. Or to try to compile V_Sim with the MPI cc compiler.
dcaliste
 
Posts: 44
Joined: Thu Oct 22, 2009 9:15 am

Re: how to link abinit to Vsim?

Postby maurosgroi » Fri Apr 16, 2010 3:14 pm

Dear Damien,
I modified the FC_MOD_NAME macro as you suggested.

I'm now trying excluding the MPI libraries. So I compiled abinit in a serial way by using:

FC=gfortran
CC=gcc
CXX=g++
LD=gfortran
export FC CC CXX LD
configure --prefix=/opt/abinit-6.0.3-serial --enable-64bit-flags --enable-optim=aggressive --enable-mpi=no --enable-bindings --disable-all-plugins --with-linalg-libs='-L/opt/lib/static//atlas -llapack -lf77blas -lcblas -latlas'

After obtaining libabinis.a I configured v_sim including the ATLAS/LAPACK libraries (otherwise I get an undefined reference to lapack subroutine):

export LIBS="-L/opt/lib/static/atlas -llapack -lf77blas -lcblas -latlas"
./configure CFLAGS='-O3 -m64 -mtune=native -fPIC' CXXFLAGS='-O3 -mtune=native -m64 -fPIC' --with-xsf --with-netcdf --with-abinit=/opt/abinit-6.0.3-serial --with-openbabel --with-cube --with-etsf-file-format --prefix=/opt/v_sim-3.5.1

Doing this v_sim configures correctly and the excutable can link the plugins to open the abinit input files.

By the way, using the MPI version of abinit and including the MPI libraries in the LIBS variable, I obtained an excutable working apparently that crashed trying to open an abinit input file.
I've a last question: in the config.log file I still get some undefined references when configure tries to check the symmetry capabilities of libabinis.a:

configure:26720: checking for symmetry capabilities in libabinis.a from /opt/abinit-6.0.3-serial/lib
configure:26746: gcc -o conftest -O3 -m64 -mtune=native -fPIC -Wall -W -ansi -Wno-error conftest.c -L/opt/lib/static/atlas -llapack -lf77blas -lcblas -latlas -L/opt/abinit-6.0.3-serial/lib -labinis -L/opt/lib/static/atlas -L/usr/lib/gcc/x86_64-linux-gnu/4.4.3 -L/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib -L/lib/../lib -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../.. -llapack -lf77blas -lcblas -latlas -lgfortranbegin -lgfortran -lm >&5
conftest.c: In function 'main':
conftest.c:13: warning: implicit declaration of function 'ab6_symmetry_new'
conftest.c:11: warning: unused parameter 'argc'
conftest.c:11: warning: unused parameter 'argv'
/opt/abinit-6.0.3-serial/lib/libabinis.a(ab6_symmetry_c.o): In function `ab6_symmetry_get_auto_k_grid':
/opt/src/abinit-6.0.3/bindings/parser/ab6_symmetry_c.c:384: undefined reference to `__m_ab6_symmetry_MOD_ab6_symmetry_binding_auto_k_1'
/opt/src/abinit-6.0.3/bindings/parser/ab6_symmetry_c.c:388: undefined reference to `__m_ab6_symmetry_MOD_ab6_symmetry_binding_auto_k_2'
/opt/abinit-6.0.3-serial/lib/libabinis.a(ab6_symmetry_c.o): In function `ab6_symmetry_get_mp_k_grid':
/opt/src/abinit-6.0.3/bindings/parser/ab6_symmetry_c.c:367: undefined reference to `__m_ab6_symmetry_MOD_ab6_symmetry_binding_mp_k_1'
/opt/src/abinit-6.0.3/bindings/parser/ab6_symmetry_c.c:371: undefined reference to `__m_ab6_symmetry_MOD_ab6_symmetry_binding_mp_k_2'
/opt/abinit-6.0.3-serial/lib/libabinis.a(ab6_symmetry_c.o): In function `ab6_symmetry_get_group':
/opt/src/abinit-6.0.3/bindings/parser/ab6_symmetry_c.c:306: undefined reference to `__m_ab6_symmetry_MOD_ab6_symmetry_get_group'
/opt/abinit-6.0.3-serial/lib/libabinis.a(ab6_symmetry_c.o): In function `ab6_symmetry_get_matrices':
/opt/src/abinit-6.0.3/bindings/parser/ab6_symmetry_c.c:262: undefined reference to `__m_ab6_symmetry_MOD_ab6_symmetry_get_matrices'
/opt/abinit-6.0.3-serial/lib/libabinis.a(ab6_symmetry_c.o): In function `ab6_symmetry_get_bravais':
/opt/src/abinit-6.0.3/bindings/parser/ab6_symmetry_c.c:223: undefined reference to `__m_ab6_symmetry_MOD_ab6_symmetry_get_bravais'
/opt/abinit-6.0.3-serial/lib/libabinis.a(ab6_symmetry_c.o): In function `ab6_symmetry_get_multiplicity':
/opt/src/abinit-6.0.3/bindings/parser/ab6_symmetry_c.c:211: undefined reference to `__m_ab6_symmetry_MOD_ab6_symmetry_get_multiplicity'
/opt/abinit-6.0.3-serial/lib/libabinis.a(ab6_symmetry_c.o): In function `ab6_symmetry_get_n_sym':
/opt/src/abinit-6.0.3/bindings/parser/ab6_symmetry_c.c:204: undefined reference to `__m_ab6_symmetry_MOD_ab6_symmetry_get_n_sym'
/opt/abinit-6.0.3-serial/lib/libabinis.a(ab6_symmetry_c.o): In function `ab6_symmetry_get_equivalent_atom':
/opt/src/abinit-6.0.3/bindings/parser/ab6_symmetry_c.c:338: undefined reference to `__m_ab6_symmetry_MOD_ab6_symmetry_get_equivalent_atom'
/opt/abinit-6.0.3-serial/lib/libabinis.a(ab6_symmetry_c.o): In function `ab6_symmetry_get_n_atoms':
/opt/src/abinit-6.0.3/bindings/parser/ab6_symmetry_c.c:197: undefined reference to `__m_ab6_symmetry_MOD_ab6_symmetry_get_n_atoms'
/opt/abinit-6.0.3-serial/lib/libabinis.a(ab6_symmetry_c.o): In function `ab6_symmetry_set_jellium':
/opt/src/abinit-6.0.3/bindings/parser/ab6_symmetry_c.c:189: undefined reference to `__m_ab6_symmetry_MOD_ab6_symmetry_set_jellium'
/opt/abinit-6.0.3-serial/lib/libabinis.a(ab6_symmetry_c.o): In function `ab6_symmetry_set_field':
/opt/src/abinit-6.0.3/bindings/parser/ab6_symmetry_c.c:182: undefined reference to `__m_ab6_symmetry_MOD_ab6_symmetry_set_field'
/opt/abinit-6.0.3-serial/lib/libabinis.a(ab6_symmetry_c.o): In function `ab6_symmetry_set_spin_orbit':
/opt/src/abinit-6.0.3/bindings/parser/ab6_symmetry_c.c:175: undefined reference to `__m_ab6_symmetry_MOD_ab6_symmetry_set_spin_orbit'
/opt/abinit-6.0.3-serial/lib/libabinis.a(ab6_symmetry_c.o): In function `ab6_symmetry_set_spin':
/opt/src/abinit-6.0.3/bindings/parser/ab6_symmetry_c.c:164: undefined reference to `__m_ab6_symmetry_MOD_ab6_symmetry_get_n_atoms'
/opt/src/abinit-6.0.3/bindings/parser/ab6_symmetry_c.c:168: undefined reference to `__m_ab6_symmetry_MOD_ab6_symmetry_set_spin'
/opt/abinit-6.0.3-serial/lib/libabinis.a(ab6_symmetry_c.o): In function `ab6_symmetry_set_structure':
/opt/src/abinit-6.0.3/bindings/parser/ab6_symmetry_c.c:156: undefined reference to `__m_ab6_symmetry_MOD_ab6_symmetry_set_structure'
/opt/abinit-6.0.3-serial/lib/libabinis.a(ab6_symmetry_c.o): In function `ab6_symmetry_set_lattice':
/opt/src/abinit-6.0.3/bindings/parser/ab6_symmetry_c.c:148: undefined reference to `__m_ab6_symmetry_MOD_ab6_symmetry_set_lattice'
/opt/abinit-6.0.3-serial/lib/libabinis.a(ab6_symmetry_c.o): In function `ab6_symmetry_set_tolerance':
/opt/src/abinit-6.0.3/bindings/parser/ab6_symmetry_c.c:131: undefined reference to `__m_ab6_symmetry_MOD_ab6_symmetry_set_tolerance'
/opt/abinit-6.0.3-serial/lib/libabinis.a(ab6_symmetry_c.o): In function `ab6_symmetry_free':
/opt/src/abinit-6.0.3/bindings/parser/ab6_symmetry_c.c:124: undefined reference to `__m_ab6_symmetry_MOD_ab6_symmetry_free'
/opt/abinit-6.0.3-serial/lib/libabinis.a(ab6_symmetry_c.o): In function `ab6_symmetry_new':
/opt/src/abinit-6.0.3/bindings/parser/ab6_symmetry_c.c:112: undefined reference to `__m_ab6_symmetry_MOD_ab6_symmetry_new'

The make command compiles correctly the program and I get a working excutable, but I don't know if the simmetries capabilities supplied by abinit are missing.

Thanks a lot and best regards,
Mauro.
maurosgroi
 
Posts: 27
Joined: Wed Apr 07, 2010 12:12 pm

Re: how to link abinit to Vsim?

Postby dcaliste » Mon Apr 19, 2010 9:39 am

Hello,

It's good to see that you succeeded in the compilation and that you can directly visualise the ABINIT input file, that's convenient.

I'm working on the fixes for the 6.0.x branch to correct automatically the issues you encountered. About the symmetry errors in the config.log, it should give the ability to V_Sim to output the space group of the represented file, using the routines from ABINIT, and to highlight equivalent atoms. (When it's working), it's located in the "interactive dialog", third tab, when you click on the interactive button of the command window. I don't know currently why it fails to compile on your machine. I'll check also.
dcaliste
 
Posts: 44
Joined: Thu Oct 22, 2009 9:15 am

Re: how to link abinit to Vsim?

Postby maurosgroi » Mon Apr 19, 2010 10:17 am

Dear Damien,
I succeeded to compile v_sim using the parallel version of abinit using mpicc as compiler instead of gcc. This is my configuration script:

export CC=mpicc
export CXX=mpic++
export LIBS="-lmpi_f90 -lmpi_cxx -lmpi_f77 -lmpi -L/opt/lib/static/atlas -llapack -lf77blas -lcblas -latlas"
./configure CFLAGS='-O3 -m64 -mtune=native -fPIC' CXXFLAGS='-O3 -mtune=native -m64 -fPIC' --with-xsf --with-netcdf --with-abinit=/opt/abinit-6.0.3-openmpi --with-openbabel --with-cube --with-etsf-file-format --prefix=/opt/v_sim-3.5.1

as you can see I explicitly linked with the MPI libraries.

The key to correctly get the symmetry capabilities is to modify the FC_MOD_NAME macro in the ab6_symmetry_c.c file:

#define FC_MOD_NAME(M,A) __ ## M ## _MOD_ ## A

and the FC_MOD_NAME in the ab6_invars_c.c as follows:

#define FC_MOD_NAME(M,A) __m_ ## M ## _MOD_ ## A

In this way the program is working correctly.
Thanks a lot and best wishes,
Mauro.
maurosgroi
 
Posts: 27
Joined: Wed Apr 07, 2010 12:12 pm

Re: how to link abinit to Vsim?

Postby maurosgroi » Mon Apr 19, 2010 11:17 am

Dear Damien,
when I use "compute symmetry" to get the space group, excutable crashes with this error:

ERROR : This part should be rewritten, at least in part, since the
original routine from which it was taken, ingeo.F90, has been improved much,
so that this section is now contained in the symanal.F90 routine.

This happens even if the configuration and compilation process was apparently correct.
Regards,
Mauro.
maurosgroi
 
Posts: 27
Joined: Wed Apr 07, 2010 12:12 pm

HOWTO compiling from version 6.0.4

Postby dcaliste » Mon Apr 26, 2010 9:31 am

Ok, all the bugs reported up to here have been corrected in version 6.0.4 and later.

Configuring with --enable-bindings to use the ABINIT library later in V_Sim requires to disable MPI (--disable-mpi) and disable ETSF_IO (--disable-etsf-io from version 6.2.x). This can be done in another compiling directory (thanks to the Autotools):
- mkdir compiling-library && cd compiling-library ;
- $ABINIT_SOURCES_DIR/configure --enable-bindings --disable-mpi --disable-etsf-io FC=gfortran ;
- make && make install ;

The trick about the #define depending on the version of Gfortran must still be applied if necessary.
dcaliste
 
Posts: 44
Joined: Thu Oct 22, 2009 9:15 am

Re: [SOLVED 6.0.4] how to link abinit to Vsim?

Postby maurosgroi » Tue May 18, 2010 3:03 pm

Dear Damien,
I had to change the file lib/plug-ins/abinit/ab_symmetry.c at line 401:

/* We get then the space group. */
/* errno = ab6_symmetry_get_group(sym, &ptGrp, &spGrp, &grpId,
&grpMagnId, genAfm); From Abinit 6.0.4 to keep track of the change in */

errno = ab6_symmetry_get_group(sym, &spGrp, &grpId, &grpMagnId, genAfm);

in order to take in account the different order (between version 6.03 and 6.04) of input parameters for the function ab6_symmetry_get_group in the file abinit-6.0.4/bindings/parser/ab6_symmetry.h.

Best regards,
Mauro.
maurosgroi
 
Posts: 27
Joined: Wed Apr 07, 2010 12:12 pm

Re: [SOLVED 6.0.4] how to link abinit to Vsim?

Postby jean-luc » Tue Jan 10, 2017 7:18 pm

Hello,

I tried to link v_sim to abinit. In fact, with the version 8.0.8 of abinit, the files transformed from ab6 to ab7 in dir ~/bindings. In that dir, README tell us to modify FC_MOD_NAME. I just found FC_MOD, and it is not at all the same syntax.

V_sim appears to compile correctly, but abinit does not compile with --enable-bindings. message here after configure :

configure: ABINIT version 8.0.8
configure: M4 010413 - Autoconf 026300 - Automake 011101 - Libtool 020206
configure: reporting user interface changes:
configure: * new option --enable-avx-safe-mode is available
configure: error: removed option --enable-bindings has been used
jlb@pcsera48:/opt/abinit-8.0.8/temp-build$ gfortran --version
GNU Fortran (Debian 4.9.2-10) 4.9.2
Copyright (C) 2014 Free Software Foundation, Inc.

So in the following, I suppose that it cause abinit not to create abinis.a
Could you tell me why ?
Best Regards
JLuc
jean-luc
 
Posts: 8
Joined: Thu Aug 11, 2016 9:29 am

Re: [SOLVED 6.0.4] how to link abinit to Vsim?

Postby pouillon » Thu Mar 09, 2017 5:05 pm

Abinit bindings to V_Sim are currently broken and unmaintained. They might be replaced by something else in the near future. There will be developers meeting this year where we will decide what to do with this part of the code. We will inform you when a decision has been taken.
Yann Pouillon
Universidad de Cantabria
Santander, Spain
User avatar
pouillon
 
Posts: 641
Joined: Wed Aug 19, 2009 10:08 am
Location: Spain

Re: [SOLVED 6.0.4] how to link abinit to Vsim?

Postby jean-luc » Thu Mar 09, 2017 5:24 pm

Dear Yann,

I appreciate V-sim alone. I suppose that the link abinit/v-sim is a kind of translator. Not to say that it is trivial.
I used v-sim alone to represent the cells, etc... and it is a nice soft and a great effort from developper,

Thanks for your reply,

Best Regards
Jean-Luc
jean-luc
 
Posts: 8
Joined: Thu Aug 11, 2016 9:29 am


Return to Link to other codes

Who is online

Users browsing this forum: No registered users and 2 guests