Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

INFO_NEEDED: gfortran fails to link automatically when fortran files are present #404

Closed
brycelelbach opened this issue Jul 10, 2012 · 7 comments
Milestone

Comments

@brycelelbach
Copy link
Member

[reported by manderson] [Trac time Mon May 7 21:42:00 2012] gfortran libraries fail to link automatically when fortran files are present.

To reproduce, use 5c45225 or later and build the embarrassingly_parallel example:

Linking CXX executable ../../bin/ep_client
CMakeFiles/ep_client_exe.dir/test.f90.o: In function `hello_':
test.f90:(.text+0x2b): undefined reference to `_gfortran_st_write'
test.f90:(.text+0x3d): undefined reference to `_gfortran_transfer_character_write'
test.f90:(.text+0x45): undefined reference to `_gfortran_st_write_done'
collect2: ld returned 1 exit status
make[3]: *** [bin/ep_client] Error 1

This bug is very important because we (LSU and IU) are under contract to port several fortran codes and we do not want to have to rewrite each fortran routine in their entirety. There must be automatic fortran support for HPX in order for these projects to succeed.

@brycelelbach
Copy link
Member Author

[comment by blelbach] [Trac time Sun Jun 3 21:33:06 2012] Matt, I cannot reproduce this. ep_client builds just fine for me (a05cf3a).

@brycelelbach
Copy link
Member Author

[comment by manderson] [Trac time Mon Jun 4 00:47:03 2012] Bryce -- you need to uncomment the test.f90 line in the CMakeLists.txt so that it actually compiles a fortran source code. I just checked in the updated CMakeLists.txt file so that you can see the error (6426800). I also just verified that the problem is still there.

@brycelelbach
Copy link
Member Author

[comment by blelbach] [Trac time Mon Jun 4 02:26:15 2012] Can't reproduce on Ithaca.

@brycelelbach
Copy link
Member Author

[comment by manderson] [Trac time Mon Jun 4 14:17:45 2012] Bryce, I just reproduced it on ithaca. Nothing tricky here. Used 6cd00a1 and standard ithaca settings. Did you remember to update prior to compiling? Did you have any conflicts you forgot to resolve?

@brycelelbach
Copy link
Member Author

[comment by blelbach] [Trac time Tue Jun 5 23:09:37 2012] Nope. I still cannot reproduce this, as of 6cd00a1 and/or 2549eea.

@brycelelbach
Copy link
Member Author

[comment by manderson] [Trac time Wed Jun 6 00:28:53 2012] that's funny, I just reproduced it again on ithaca. The most likely source of this discrepancy is that you are including a library which automatically links with gfortran, such as hdf5_fortran. Please turn off these libraries when you configure cmake so that you can see the problem.

Some questions (my answers in parenthesis)
What are you compiling? ( embarrassingly_parallel)
What compiler are you using? (gcc 4.6.2)
What boost are you using? ( 1.47.0_debug )

Exodus_fortran_found OFF
HDF5_fortran_found OFF
MPI_fortran_found OFF
Netcdf_found OFF

@brycelelbach
Copy link
Member Author

[comment by blelbach] [Trac time Wed Jun 6 18:27:08 2012] I think you're going to have to manually add gfortran to the library dependencies - I've investigated this, and there's no way that I can easily check if a project is pure C++ or C++ and gfortran. For example:

  set(dependencies
      gfortran
      distributing_factory_component)

  add_hpx_executable(foo
    SOURCES foo.cpp
    DEPENDENCIES ${dependencies}
    FOLDER "Examples/Foo)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant