[CMake] fortran compiler failed to compile simple test program

Ette, Anthony (CDS) Anthony.R.Ette at controlsdata.com
Tue Jun 16 13:44:42 EDT 2015


> http://www.cmake.org/gitweb?p=cmake.git;a=blob;f=Modules/CMakeDetermineFortranCompiler.cmake;hb=v3.3.0-rc2#l114

Ok.  I'm still struggling getting anything unique from the cf77 command line.  They have plenty of custom functions that can be invoked outside of cf77 but that wouldn't be suitable for cmake.  Also, I got a response from Concurrent on the issue with the -rdynamic option.  Please see his resonse below and let me know what you think.  I need to get Cmake to work and, ideally, I'd like it to work with -rdynamic.  I'm wondering if there is something they can change (other than the ugly kludge he references) to get -rdynamic to work.


Hi Anthony:

Okay, the -rdynamic option to cf77 instructs it to build
a shared object (shared library), not an executable program.

I doubt this is what you intended, rather CMake just
wanted to link the program with the system dynamic
libraries -- it's unclear.

By default, cf77 links in all system libraries dynamically
anyway, which is a standard default way most compilers
operate in the Linux world.  I'm not sure why CMake would
be passing -rdynamic along, unless you really are
trying to build a dynamic fortran shared library.

(It is possible it is trying to force a transitive closure of
symbol references for debugging purposes -- that's
what gcc describes its -rdynamic option as doing).

I don't use CMake, and I can imagine it may be difficult
to use if it isn't flexible wrt compilation and linking options.

If you could abandon CMake for standard GNU make, that
would be good, but of course that may not be acceptable
to you in terms of man power, style, etc.

If CMake is indeed forcing this option on every command
that links a program, the best I can recommend is to
replace the /usr/css/bin/cf77 with a wrapper that strips
out the option and then continues to invoke the real cf77.

That is of course a horrible kludge.

If you would like me to supply you with that (albeit disgusting)
workaround, just let me know.

I'd recommend fighting with CMake first.

Alternative, I can supply you with some simple example
gmake Makefiles that you might use with cf77.

Please let me know what you think about this.

Also, I'm concerned that your man pages are not installed
properly (the CF77 man pages).

I recommend doing the following to rectify that:
rpm -q ccurf77-manpages-7.3 --nodeps
rpm -Uvh cf77-manpages-7.3*.rpm # File attached
man cf77

If that does not work, please try the following:
man -M /opt/ccur/compilers-7.3/man cf77
If that works, then you can put that path in your MANPATH
environment variable, or edit /etc/man.config and put the
path in that file so everyone will benefit from it.

Alternatively, we can chase this down to the final bit
depending on how much time you want to spend on it.

-- Jeff
This e-mail (including attachments) contains contents owned by Rolls-Royce plc and its subsidiaries, affiliated companies or customers and covered by the laws of England and Wales, Brazil, US, or Canada (federal, state or provincial). The information contained in this email is intended to be confidential, may be legally privileged and subject to export controls which may restrict the access to and transfer of the information. If you are not the intended recipient, you are hereby notified that any retention, dissemination, distribution, interception or copying of this communication is strictly prohibited and may subject you to further legal action. Reply to the sender if you received this email by accident, and then delete the email and any attachments.


More information about the CMake mailing list