User forums > Help

Problem with a call to ar

(1/4) > >>

gd_on:
I'm making a library by compiling several fortran sources.
Compilation of each source is OK but when making the library with the call to ar I obtain an error.
Here is the full log obtained :

--- Code: ----------------- Générer : libsphr dans Test (compilateur : Compilateur Fortran GNU)---------------

mingw32-gfortran.exe -Jobj -w -Wall -finit-real=nan  -O2 -fbounds-check -Wuninitialized -ftrapv -fimplicit-none -fno-automatic    -I..\inc -c D:\Users\Gerard\Test\error_mesg.f90 -o obj\Test\error_mesg.o
mingw32-gfortran.exe -Jobj -w -Wall -finit-real=nan  -O2 -fbounds-check -Wuninitialized -ftrapv -fimplicit-none -fno-automatic    -I..\inc -c D:\Users\Gerard\Test\math_latlon_to_vect.f90 -o obj\Test\math_latlon_to_vect.o
mingw32-gfortran.exe -Jobj -w -Wall -finit-real=nan  -O2 -fbounds-check -Wuninitialized -ftrapv -fimplicit-none -fno-automatic    -I..\inc -c D:\Users\Gerard\Test\sphr_module_variables.f90 -o obj\Test\sphr_module_variables.o
mingw32-gfortran.exe -Jobj -w -Wall -finit-real=nan  -O2 -fbounds-check -Wuninitialized -ftrapv -fimplicit-none -fno-automatic    -I..\inc -c D:\Users\Gerard\Test\stripack.f90 -o obj\Test\stripack.o
mingw32-gfortran.exe -Jobj -w -Wall -finit-real=nan  -O2 -fbounds-check -Wuninitialized -ftrapv -fimplicit-none -fno-automatic    -I..\inc -c D:\Users\Gerard\Test\stripack_module_variables.f90 -o obj\Test\stripack_module_variables.o
mingw32-gfortran.exe -Jobj -w -Wall -finit-real=nan  -O2 -fbounds-check -Wuninitialized -ftrapv -fimplicit-none -fno-automatic    -I..\inc -c D:\Users\Gerard\Test\sphr_init.f90 -o obj\Test\sphr_init.o
mingw32-gfortran.exe -Jobj -w -Wall -finit-real=nan  -O2 -fbounds-check -Wuninitialized -ftrapv -fimplicit-none -fno-automatic    -I..\inc -c D:\Users\Gerard\Test\sphr_recup_lum.f90 -o obj\Test\sphr_recup_lum.o
mingw32-gfortran.exe -Jobj -w -Wall -finit-real=nan  -O2 -fbounds-check -Wuninitialized -ftrapv -fimplicit-none -fno-automatic    -I..\inc -c D:\Users\Gerard\Test\sphr_vis_crira_2_sphr.f90 -o obj\Test\sphr_vis_crira_2_sphr.o
ar.exe -r ..\lib\libsphr.a obj\Test\error_mesg.o obj\Test\math_latlon_to_vect.o obj\Test\sphr_module_variables.o obj\Test\stripack.o obj\Test\stripack_module_variables.o obj\Test\sphr_init.o obj\Test\sphr_recup_lum.o obj\Test\sphr_vis_crira_2_sphr.o\nranlib ..\lib\libsphr.a
ar.exe: creating ..\lib\libsphr.a
ar.exe: obj\Test\sphr_vis_crira_2_sphr.o\nranlib: No such file or directory
Le processus s'est terminé avec le code d'état 1 (2 minute(s), 9 seconde(s))
0 erreur(s), 0 avertissement(s) (2 minute(s), 9 seconde(s))
--- End code ---

I think the problem comes from the \nranlib added at the end of enumeration of .o files in the ar command. The last .o is misinterpreted as a full name "obj\Test\sphr_vis_crira_2_sphr.o\nranlib" which does not exists, but  obj\Test\sphr_vis_crira_2_sphr.o exists.
I have seen that in options_gfortran.xml there is a line with \nranlib (163). Could my problem comes from here ? What I can do ?

I use CB svn 8800 on windows xp compiled by myself, and tdm 4.7.1 compilers (gcc and gfortran).

gd_on

PS : this \nranlib appears in 3 other xml files.

PS 2 : May be I'm wrong but I suppose that this command at line 163 in options_gfortran.xml is in fact 2 commands separated by a new line character (the \n). On my PC, it's not interpreted correcly. But, may be it's possible to replace this 2 line command, by only a 1 line command, beginning by ar -s -r, so something like $lib_linker -s -r $static_output $link_objects. Adding -s should do the same thing than adding a call to ranlib ? it that right ? on every system ?

gd_on:
I have also this problem on a CentOS machine. But, strangely, on a Redhat one it works : the \n on the ar line (within options-gfortran.xml) is correctly interpreted!

gd_on

oBFusCATed:
Is it possible to provide a sample project which reproduces this problem?

hint: you can copy the files for your project and then you can replace the content with something that just compiles.

gd_on:
I'll try do provide a test case tomorrow.

gd_on

gd_on:
Here is a small test case.
With standard line 163 in options_gfortran.xml, gives the error.
No error if I delete the \nranlib $static_output, it works.
I can also add -s just before -r, but I'm not sure it's usefull : I see no diffrence on the size of the built library.

gd_on

PS : the .cbp file is inside the make subfolder

Navigation

[0] Message Index

[#] Next page

Go to full version