radiasoft / zgoubi

Git repo for zgoubi source code
https://sourceforge.net/projects/zgoubi/
GNU General Public License v2.0
9 stars 3 forks source link

U flag in ARFLAGS not recognised in macports version of archiver #45

Closed davidkelliher closed 5 years ago

davidkelliher commented 5 years ago

When installing zgoubi on a Macbook using the macports version of gfortran as the compiler (gcc version 5.5.0), the compile fails when it encounters the "U" in ARFLAGS in the first line of the following Makefiles

zgoubi/coupling/Makefile zgoubi/svd/Makefile

Running "man ar" on my Linux system I see the following info on the U flag "Do not operate in deterministic mode. This is the inverse of the D modifier, above: added files and the archive index will get their actual UID, GID, timestamp, and file mode values. This is the default unless binutils was configured with --enable-deterministic-archives".

I can confirm that this option is absent in the Macports version of ar. The compile succeeds when I delete the U from the ARFLAGS line in both Makefiles.

zbeekman commented 5 years ago

@davidkelliher I believe this repository is transitioning away from using the Makefiles, in favor of the meta-build system, CMake. CMake will generate makefiles during the configure and generate phase, then you can build zgoubi with the makefiles. https://CMake.org provides binary distributions of CMake for macOS, and it should also be available in your favorite macOS package management system (i.e. macports or Homebrew).

Compiling with CMake typically looks something like this:

cd zgoubi # top level of zgoubi source
mkdir build
cd build
FC=/path/to/gfortran CC=/path/to/gcc cmake -DCMAKE_INSTALL_PREFIX=/where/to/install/zgoubi ..
# DCMAKE_INSTALL_PREFIX is optional, only needed if you plan to `make install`
# the .. is just a path to the zgoubi top level source
# if you don't specify FC and CC, CMake will probably find your default gfortran (unless you have Intel's ifort installed) and clang. Using clang should be fine
make install # optional

Alternatively, if you wish to run inside the docker image, install docker on your system, and then just run the ./travis.sh script. This will build zgoubi in the Radiasoft Fedora docker image. Build outputs will be in:

/path/to/zgoubi-repo/cmake-build
davidkelliher commented 5 years ago

OK thanks!