On 2010-01-15 17:38+0100 Joachim Geiger wrote: > Joachim Geiger wrote: >> Hi, >> I have troubles building the fortran examples on my linux system >> (openSUSE 11.2, x86_64, gcc (SUSE Linux) 4.4.2 [gcc-4_4-branch revision >> 155802]) >> for plplot version 5.9.5. Everything works fine with building the examples >> up to the point where x01f should be linked. There I get: >> Linking CXX executable x01f >> cd /home/geiger/build_dir/plplot-5.9.5_gfortran/examples/f77&& >> /usr/bin/cmake -E cmake_link_script CMakeFiles/x01f.dir/link.txt --verbose=1 >> /usr/bin/c++ CMakeFiles/x01f.dir/x01f.f.o -o x01f -rdynamic >> ../../bindings/f77/libplplotf77d.a ../../bindings/f77/libplplotf77cd.a >> ../../src/libplplotd.a -lpangocairo-1.0 -lpango-1.0 -lcairo >> -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lSM -lICE -lX11 -lXext -lSM >> -lICE -lX11 -lXext -lpthread -pthread -lwx_baseu-2.8 -lwx_gtk2u_core-2.8 >> ../../lib/csa/libcsirocsa.a ../../lib/qsastime/libqsastime.a -lm >> /usr/lib64/gcc/x86_64-suse-linux/4.4/../../../../lib64/crt1.o: In >> function `_start': >> /usr/src/packages/BUILD/glibc-2.10.1/csu/../sysdeps/x86_64/elf/start.S:109: >> undefined reference to `main' >> CMakeFiles/x01f.dir/x01f.f.o: In function `MAIN__': >> x01f.f:(.text+0x16): undefined reference to `_gfortran_set_options' >> x01f.f:(.text+0x88): undefined reference to `_gfortran_st_write' >> ... >> >> The obvious point I noted is that the linking is done with c++ and not >> with gfortran. Entering the folder CMakefiles/x01f.dir and executing >> the link-command with gfortran instead of c++ gives a nice working >> executable. >> Any idea where things could have went wrong? Or has anyone encountered the >> problem before? >> Best regards, >> Joachim >> >> >> > Sorry, I need to add something, because I may have misunderstood something. > I started the building with the following line: > cmake -DCMAKE_INSTALL_PREFIX=/usr/local/gfortran_plplot595 > -DBUILD_TEST=ON -DCMAKE_VERBOSE_MAKEFILE=ON -DENABLE_DYNDRIVERS=OFF > -DBUILD_SHARED_LIBS=OFF -DENABLE_octave=OFF -DPLD_plmeta=ON > ~/svn_work/programming/plplot/plplot-5.9.5 > > The main point is that it is done in the external build-directory > prior to installation with setting -DBUILD_TEST=ON.
Thanks, Joachim, for that additional clarification. It illustrates how important the exact cmake options are. I confirm the issue for cmake-2.8.0 and the svn trunk version of PLplot as well, but _just_ for the -DBUILD_SHARED_LIBS=OFF case (which also forces -DENABLE_DYNDRIVERS=OFF). I am pretty sure this is a cmake bug because if I switch to cmake-2.6.4 the problem disappears. Would you confirm that version change (or a version change to anything in the cmake-2.6.x series that is suitable for you) solves your issue as well? Also, the problem disappears for both cmake-2.6.4 and 2.8.0 if I use the default -DBUILD_SHARED_LIBS=ON, -DENABLE_DYNDRIVERS=ON case. Thanks very much for your report, and I will be working on verifying that this is really a cmake bug by using a simple test case rather than the whole PLplot build (where we do a few special extra things with basic Fortran language support under CMake which potentially might also be the source of the problem here with cmake-2.8.0). Alan __________________________ Alan W. Irwin Astronomical research affiliation with Department of Physics and Astronomy, University of Victoria (astrowww.phys.uvic.ca). Programming affiliations with the FreeEOS equation-of-state implementation for stellar interiors (freeeos.sf.net); PLplot scientific plotting software package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of Linux Links project (loll.sf.net); and the Linux Brochure Project (lbproject.sf.net). __________________________ Linux-powered Science __________________________ ------------------------------------------------------------------------------ Throughout its 18-year history, RSA Conference consistently attracts the world's best and brightest in the field, creating opportunities for Conference attendees to learn about information security's most important issues through interactions with peers, luminaries and emerging and established companies. http://p.sf.net/sfu/rsaconf-dev2dev _______________________________________________ Plplot-general mailing list Plplot-general@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/plplot-general