Skip to content

Conversation

zbeekman
Copy link
Contributor

@zbeekman zbeekman commented May 7, 2014

I tried to test it pretty thoroughly on Mac and Linux. On Mac I tested with ifort beta 2015 and gfortran 4.9 stable. On linux I only tested with ifort 13.1.

The toughest bit was building the dynamic/shared libraries correctly and exporting the project so that other CMake projects can find them and link against them with the correct -rpath linker flag especially when DESTDIR is passed to make install

  • I have yet to change the install directories for the mod files so that they live besides the library files
  • I have yet to implement the make check automated testing
    • As such, I am not compiling or linking the json_example.f90 program. I am planning on using this as the foundation of the automated testing by comparing the json files to std out and std out to the expected output. On linux you can even add valgrind to the testing.

Hopefully if y�ou download CMake you can give it a spin pretty easily.

zbeekman added 13 commits April 30, 2014 15:49
Features:
- Export targets from BOTH the build AND install trees
- README.md updated to reflect addition of CMake support
TODO:
- Add tests using json_example.f90
- Test on Linux (and Windows?)
- Add uninstall target?
- README.md updated and reflowed
- jsonfortran-${CMAKE_Fortran_COMPILER_ID} is now passed to `find_package()`
  by projects wishing to import jsonfortran
- libraries and mod files installed under fortran/${CMAKE_Fortran_COMPILER_ID}
  to enable parallel installation of packages built by different compilers the
  package config logic ensures that the correct compiler is used
1. For some reason, CMake refuses to add the requisit linker
   flags (`-Wl,-rpath,/path/to/dylib`) when building executables
   against the imported dylib on Mac OS X and the Intel compilers.
   gfortran 4.9 seems to not trigger this CMake bug for some reason.
   Still investigating.
1. An option is present to select absolute install_name_dir vs @rpath
   on Mac when building the dylib. Since some issues with @rpath and
   CMake persist the `INSTALL_NAME_DIR` property is used rather than
   `@rpath`
1. However, if `DESTDIR=...` is defined when you `make install` the
   install name dir set at congigure time is no longer correct.
   Some install time CMake code was added to help fix this.
1. Some cached properties controling the build behavior were re-
   named to enable better grouping in `cmake-gui` and `ccmake`
More quoting of file names and directories to be defensive.
@rpath seems to work all the time now, except when using DESTDIR
to install. Also, the contents of <proj>-targets.cmake seem to be
pointing to incorrect places to find targets, but this doesn't seem
to cause any issues. (other than, perhaps, the @rpath issue)
…build

This incorporates upstream changes from
github.com:jacobwilliams/json-fortran made by @jacobwilliams.
Conflicts:
	README.md
Introduced by accidental paragraph reflow
@@ -1,4 +1,5 @@
bin/
lib/
builds/
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is what I use as my build directory, or dirs under this… Usually one for intel one for gfortran

zbeekman added 6 commits May 7, 2014 19:09
mod files are now installed along library archives/objects,
under `<prefix>/lib/<project>-<version>/<compilerID>/`
Some variables were refactored to, to try to simplify
the CMakeLists.txt file.
Pushed some CMake ugliness to included files
e.g. /usr/local/jsonfortran-intel-1.0.0
@zbeekman
Copy link
Contributor Author

@jacobwilliams

  1. Do you want me to squash my commits? (Probably a good practice for security reasons)
  2. Is there anything you want me to change?

@jacobwilliams
Copy link
Owner

  1. From what I've read, I would say no. I think it's better to maintain the history... unless I'm misunderstanding this concept.
  2. Haven't had a chance to try out CMake yet.

@zbeekman
Copy link
Contributor Author

  1. The danger is that someone can introduce a security vulnerability hidden in a commit, then over write it in a second commit before sending a pull request. That means that the entire history of the pull request must be carefully examined for security issues, where as if you squash the commit this is no longer an issue. It’s a bit paranoid I know, but here is a rather lengthy article describing what could go wrong. Shouldn’t be an issue for this hobby project though.
  2. OK, no worries. When I get a chance to implement the CTest testing and better examples I’ll commit them to my CMake-build branch unless you’ve closed the pull request. I want to include an example (maybe on the README.md or a separate example file) of using ExternalProject_Add() to drive the download (via git clone) and build of json-fortran before linking the example project executable against it.

jacobwilliams added a commit that referenced this pull request Jun 5, 2014
@jacobwilliams jacobwilliams merged commit c7e3120 into jacobwilliams:master Jun 5, 2014
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

Successfully merging this pull request may close these issues.

2 participants