#109 closed defect (fixed)
unrecognized option '-R/usr/X11/lib'
Reported by: | Owned by: | MatthewWhiting | |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | Building/Installation | Version: | 1.1.10 |
Severity: | normal | Keywords: | linker error |
Cc: |
Description
I'm trying to build/install duchamp and am getting this error when performing the 'make' command:
i686-apple-darwin8-gfortran-4.2: unrecognized option '-R/usr/X11/lib'
ld: library not found for -lstdc++
collect2: ld returned 1 exit status
make: * [duchamp] Error 1
====
I've tried to look around to fix the problem but I can't find anything about it.
I will try and attach the config.log
Cheers, Brent
Attachments (4)
Change History (21)
Changed 13 years ago by
Attachment: | config.log added |
---|
comment:1 Changed 13 years ago by
Status: | new → assigned |
---|
Hi Brent,
The actual problem here is with the libstdc++ library not being found. Which is a bit of a puzzle, because the configure script explicitly searches for it (and finds it OK...)
Can you attach the Makefile, so I can see how it is trying to do the build?
The fact that -R/usr/X11/lib is not recognised doesn't matter. I'm actually not entirely sure where that is coming from - something about recent versions of autoconf and how it does its X-library searching...
Matt.
comment:2 Changed 13 years ago by
Hi Matt,
Yeah I have spent all yesterday and this morning trying to figure the libstdc++ thing to no avail, so I thought it must have been the X11 thing.
I'll attach the Makefile too
Cheers, Brent
comment:3 Changed 13 years ago by
It might be worth trying to specify library paths when you run configure. It seems that for your system, libstdc++ is either in /usr/lib or /usr/local/lib. Have a look, and see which one it is in. Then do
./configure LDFLAGS=/usr/lib
or /usr/local/lib as required.
Hopefully this should put the correct directory in the Makefile. Otherwise you could just hack the Makefile afterwards (putting the correct -L flag in yourself), but it's better to get configure to do it for you...
comment:4 Changed 13 years ago by
Hey Matt,
I tried to specify the library paths using the
./configure LDFLAGS=/usr/lib
as above, (as that is where my libstd++ libraries are) but i am greeted with this:
# ./configure F77=gfortran LDFLAGS=/usr/lib checking for g++... g++ checking for C++ compiler default output file name... configure: error: C++ compiler cannot create executables See `config.log' for more details.
I've attached the new config.log ... but can you also give me a hint how to hack the Makefile, I don't really know much about them...
Cheers, B
comment:5 Changed 13 years ago by
Oops, my mistake. The syntax you're after is
./configure LDFLAGS=-L/usr/lib
comment:6 Changed 13 years ago by
Hey Matt,
Unfortunately that doesn't change anything for me, still get the same errors as above..
However, I do notice that the first option after the linking step
gfortran -o Duchamp-1.1.10 ./src/mainDuchamp.o ..[many.o files].. -L/usr/local/lib -lwcs ...
Even though I used the ./configure F77=gfortran LDFLAGS=-L/usr/lib
?
Has that not seemd to do what it was expected?
Could this have something to do with the i686-apple-darwin8-gfortran-4.2 which I'm using? I presume that there are many others who have successfully compiled this for Mac OS?
Cheers, B
comment:7 Changed 13 years ago by
As another question,
would obtaining and installing g95 change anything, as opposed to using gfortran?
Cheers,
B
comment:8 Changed 13 years ago by
Hi Matt,
Some good(ish) news ... I managed to force the linker to use a different version of gfortran that I have installed and it will now complete the make step (although it still complains about X11: gfortran-mp-4.2: unrecognized option '-R/usr/X11/lib'). I did this by changing the Makefile such that
F77= /opt/local/bin/gfortran-mp-4.2 $(FFLAGS) LINK= /opt/local/bin/gfortran-mp-4.2
However, in the next step when I verify it, with ./VerifyDuchamp?.sh, I get Segmentation fault errors...
I run this:
./VerifyDuchamp.sh > verify_output.log Segmentation fault grep: ./verification/results1.txt: No such file or directory -bash: [: ==: unary operator expected diff: ./verification/results1.txt: No such file or directory expr: non-numeric argument Segmentation fault grep: ./verification/results2.txt: No such file or directory -bash: [: ==: unary operator expected diff: ./verification/results2.txt: No such file or directory expr: non-numeric argument Segmentation fault grep: ./verification/results3.txt: No such file or directory -bash: [: ==: unary operator expected diff: ./verification/results3.txt: No such file or directory expr: non-numeric argument Segmentation fault grep: ./verification/results4.txt: No such file or directory -bash: [: ==: unary operator expected diff: ./verification/results4.txt: No such file or directory expr: non-numeric argument Segmentation fault grep: ./verification/results5.txt: No such file or directory -bash: [: ==: unary operator expected diff: ./verification/results5.txt: No such file or directory expr: non-numeric argument Segmentation fault grep: ./verification/results6.txt: No such file or directory -bash: [: ==: unary operator expected diff: ./verification/results6.txt: No such file or directory expr: non-numeric argument Segmentation fault grep: ./verification/results7.txt: No such file or directory -bash: [: ==: unary operator expected diff: ./verification/results7.txt: No such file or directory expr: non-numeric argument -bash: [: ==: unary operator expected
I've also attached the verify_output.log if that will help..
Any ideas?
Cheers for your help so far,
B
comment:9 Changed 13 years ago by
Hi Matt,
Further investigations today and I have found that I'm able to build Duchamp as long as I use the --without-pgplot option in the configuration stage. Then using the standard Mac setting of F77=gfortran, everything builds fine. Now I can verify it and it says that all is fine.
What's really bugging me though is that pgplot is there and is working fine! I can go to my pgplot directory (/opt/local/share/pgplot) and use the examples, specify XWINDOW as the display device and everything is fine...Why can't Duchamp find it?!!
comment:10 Changed 13 years ago by
Hi Brent,
(Have been travelling, hence the delay in getting back to you.)
- Verification script - it seems that Duchamp is not running correctly, as it is not producing the correct output files. Can you try running just one of the tests to see what happens? eg. ./Duchamp-1.1.10 -p verification/input1
- gfortran & pgplot - I seem to recall that there are issues with building against pgplot if you use a gfortran that was *not* used to build the pgplot package. It may be that it was built with the /opt/local/bin/gfortran-mp-4.2 that you were able to get running above. Note that rather than hacking the Makefile, you should be able do it at the configure stage:
./configure F77=/opt/local/bin/gfortran-mp-4.2
comment:11 Changed 13 years ago by
Hi Matt,
Thanks for still thinking about this, but I'm still getting errors, albeit slightly different this time:
#./configure F77=/opt/local/bin/gfortran-mp-4.2 .... # make clean # make .... gfortran-mp-4.2: unrecognized option '-R/usr/X11/lib' Undefined symbols: "_pgwcsl_", referenced from: _pgwcsl_$non_lazy_ptr in plotting.o "_cpgsbox", referenced from: duchamp::plotWCSaxes(wcsprm*, long*, int, int)in plotting.o ld: symbol(s) not found collect2: ld returned 1 exit status make: *** [duchamp] Error 1
Cheers, B
comment:12 Changed 13 years ago by
That looks like it is not linking against wcslib properly (pgwcsl and cpgsbox are both wcslib functions). Are the WCSLIB/WCSINC parameters defined in the Makefile? That is, is it doing the linking properly?
comment:13 Changed 13 years ago by
Hi Matt,
From the Makefile, I have:
WCSINC = -I/usr/local/include -I/usr/local/include/wcslib WCSLIB = -L/usr/local/lib -lwcs
I have looked in these folders and have wcslib stuff there, so that appears correct..?
Cheers, B
comment:14 Changed 13 years ago by
OK, the problem is that there is a second library with wcslib - pgsbox. I had problems getting this recognised by configure when gfortran was being used, so added a hack where it just adds it in when the F77 compiler is gfortran.
What seems to be the problem is that it checks for an exact match, so if you have gfortran-mp-4.2 it won't do the hack...
Quick solution for you is to just manually add -lpgsbox after the -lwcs in the Makefile, and it should link properly. I'll try and sort out what's going wrong with the configure script...
comment:15 Changed 13 years ago by
Hi Matt,
I've recently updated my Macports system and now have a few more gcc options (mp-gcc42 (4.2.4), mp-gcc43 (4.3.5), mp-gcc44 (4.4.5)) and a more recent version of pgplot (5.2.2 rev.6), and just made the latest wcslib-4.7
I am using a gcc_select program to switch between gcc versions, and also using the F77=/opt/local/bin/gfortran-XX, otherwise it defaults to F77=gfortran (which I'm pretty sure points back to /opt/local/bin/gfortran-XX anyway). Each time I check the Makefile after the configure step and make sure it has changed the F77 compiler each time to the one that I'm expecting and also add the extra -lpgsbox to the WCSLIB option. Finally I check again via the command line. So doing:
# gcc --version gcc (GCC) 4.2.4 # gfortran --version GNU Fortran (GCC) 4.2.4 # /opt/local/bin/gfortran --version GNU Fortran (GCC) 4.2.4 # /opt/local/bin/gfortran-mp-4.2 --version GNU Fortran (GCC) 4.2.4 # ./configure F77=/opt/local/bin/gfortran-mp-4.2 ... [[Check the Makefile for the F77 option and WCSLIB flag]] make clean make ... src/Cubes/drawBlankEdges.cc: In function 'void duchamp::drawBlankEdges(float*, int, int, duchamp::Param&)': src/Cubes/drawBlankEdges.cc:56: error: 'cpgtest' was not declared in this scope src/Cubes/drawBlankEdges.cc:62: error: 'DUCHAMP_BLANK_EDGE_COLOUR' was not declared in this scope make: *** [src/Cubes/drawBlankEdges.o] Error 1
I get the above error using any of the mp-gccXX versions
Where as if I go back to my:
gcc42 which is i686-apple-darwin9-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5577)
or gcc40 which is i686-apple-darwin9-gcc-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5493)
and change to the /usr/local/bin/gfortran-4.2 or /usr/bin/gfortran-4.2
# gcc_select gcc42 # gcc --version i686-apple-darwin9-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5577) # /usr/bin/gfortran-4.2 --version GNU Fortran (GCC) 4.2.1 (Apple Inc. build 5577) # ./configure F77=/usr/bin/gfortran-4.2 ... [[ check Makefile for F77 and WCSLIB flag ]] make clean make ... ... no errors!!
Next I can't believe my luck so I do:
# ./VerifyDuchamp.sh ... [[ PGPLOT windows pop-up ]] ... No errors! Everything is working fine. Happy Finding! If you ever need to report a bug or request an upgrade, go to http://svn.atnf.csiro.au/trac/duchamp/newticket
Its a little strange that it won't compile on any of the Macports variants of gcc4.X but alas, I have a working copy!
Thank you so much for all your help!
Cheers, B
comment:16 Changed 13 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Good to hear it is working.
I will investigate the build problems you mentioned in the last update. I have 4.2.1 on this machine, so it looks like 4.2.4 is a bit more strict about some things.
comment:17 Changed 9 years ago by
mari kita main <a href=http://sport.detik.com/sepakbola/>sepakbola</a> mari kita main <a href=http://sport.detik.com/sepakbola/>sepakbola</a>
Config.log