Hello all,
I’m trying to make a derivation of this repository: GitHub - sourceryinstitute/OpenCoarrays: A parallel application binary interface for Fortran 2018 compilers., and am running into some problems I don’t understand.
Firstly, building ‘by hand’ works fine:
git clone https://github.com/sourceryinstitute/OpenCoarrays.git
nix-shell -p gfortran mpich cmake --pure
cd OpenCoarrays
mkdir build && cd build
cmake ..
make
yields the expected files under build/bin and build/lib64.
So, I thought to try turning this into a derivation.
The recipe I first used is the following:
# build.nix
{
cmake,
gfortran,
mpich,
stdenv,
fetchFromGitHub,
}:
stdenv.mkDerivation rec {
pname = "OpenCoarrays";
version = "2.10.2";
src = fetchFromGitHub {
owner = "sourceryinstitute";
repo = "OpenCoarrays";
rev = version;
hash = "sha256-Go5PQQRC9OChRY37ShhCYyLo7tWSI3gwoo6pTSXyG9A=";
};
nativeBuildInputs = [
cmake
gfortran
];
buildInputs = [
mpich
];
installPhase = ''
mkdir -p $out/bin $out/lib64
cp bin/caf $out/bin/caf
cp bin/cafrun $out/bin/cafrun
cp -r lib64 $out/lib64
ln -s $out/lib64 $out/lib
'';
}
yet, when running nix-build
(with the appropriate default.nix
file present) I get an error that a certain fortran module is not being loaded (from the nix store?), which is attached below.
Summary
this derivation will be built:
/nix/store/xx8qd2k7vsri5dfjdcfwfw0rqdimfgdb-OpenCoarrays-2.10.2.drv
building '/nix/store/xx8qd2k7vsri5dfjdcfwfw0rqdimfgdb-OpenCoarrays-2.10.2.drv'...
Running phase: unpackPhase
unpacking source archive /nix/store/sg83g0y78m5n6plqyg46bib5ya5ad1pi-source
source root is source
Running phase: patchPhase
Running phase: updateAutotoolsGnuConfigScriptsPhase
Running phase: configurePhase
fixing cmake files...
cmake flags: -DCMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY=OFF -DCMAKE_FIND_USE_PACKAGE_REGISTRY=OFF -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF -DCMAKE_INSTALL_LOCALEDIR=/nix/store/19ansk9r29rfji1ar10rjwmpgc61gxlk-OpenCoarrays-2.10.2/share/locale -DCMAKE_INSTALL_LIBEXECDIR=/nix/store/19ansk9r29rfji1ar10rjwmpgc61gxlk-OpenCoarrays-2.10.2/libexec -DCMAKE_INSTALL_LIBDIR=/nix/store/19ansk9r29rfji1ar10rjwmpgc61gxlk-OpenCoarrays-2.10.2/lib -DCMAKE_INSTALL_DOCDIR=/nix/store/19ansk9r29rfji1ar10rjwmpgc61gxlk-OpenCoarrays-2.10.2/share/doc/opencoarrays -DCMAKE_INSTALL_INFODIR=/nix/store/19ansk9r29rfji1ar10rjwmpgc61gxlk-OpenCoarrays-2.10.2/share/info -DCMAKE_INSTALL_MANDIR=/nix/store/19ansk9r29rfji1ar10rjwmpgc61gxlk-OpenCoarrays-2.10.2/share/man -DCMAKE_INSTALL_OLDINCLUDEDIR=/nix/store/19ansk9r29rfji1ar10rjwmpgc61gxlk-OpenCoarrays-2.10.2/include -DCMAKE_INSTALL_INCLUDEDIR=/nix/store/19ansk9r29rfji1ar10rjwmpgc61gxlk-OpenCoarrays-2.10.2/include -DCMAKE_INSTALL_SBINDIR=/nix/store/19ansk9r29rfji1ar10rjwmpgc61gxlk-OpenCoarrays-2.10.2/sbin -DCMAKE_INSTALL_BINDIR=/nix/store/19ansk9r29rfji1ar10rjwmpgc61gxlk-OpenCoarrays-2.10.2/bin -DCMAKE_INSTALL_NAME_DIR=/nix/store/19ansk9r29rfji1ar10rjwmpgc61gxlk-OpenCoarrays-2.10.2/lib -DCMAKE_POLICY_DEFAULT_CMP0025=NEW -DCMAKE_OSX_SYSROOT= -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_STRIP=/nix/store/jm9dj9vgid480w3sq8lfsl65azizx0fj-gfortran-wrapper-13.2.0/bin/strip -DCMAKE_RANLIB=/nix/store/jm9dj9vgid480w3sq8lfsl65azizx0fj-gfortran-wrapper-13.2.0/bin/ranlib -DCMAKE_AR=/nix/store/jm9dj9vgid480w3sq8lfsl65azizx0fj-gfortran-wrapper-13.2.0/bin/ar -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_INSTALL_PREFIX=/nix/store/19ansk9r29rfji1ar10rjwmpgc61gxlk-OpenCoarrays-2.10.2
-- ------------------------------------------------------------------------------- --
_/_/
_/ _/ _/_/_/ _/_/ _/_/_/
_/ _/ _/ _/ _/_/_/_/ _/ _/
_/ _/ _/ _/ _/ _/ _/
_/_/ _/_/_/ _/_/_/ _/ _/
_/
_/
_/_/_/
_/ _/_/ _/_/_/ _/ _/_/ _/ _/_/ _/_/_/ _/ _/ _/_/_/
_/ _/ _/ _/ _/ _/_/ _/_/ _/ _/ _/ _/ _/_/
_/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/_/
_/_/_/ _/_/ _/_/_/ _/ _/ _/_/_/ _/_/_/ _/_/_/
_/
_/_/
OpenCoarrays
""""""""""""
Build Type: Release
Version: 2.10.2
-- ------------------------------------------------------------------------------ --
-- Running with CMake from: /nix/store/28s979fhz8d6h1rny3n5zh1ybmby6kjz-cmake-3.29.2/bin/cmake
-- Current source dir (for OpenCoarrays): /build/source
-- The C compiler identification is GNU 13.2.0
-- The Fortran compiler identification is GNU 13.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /nix/store/jm9dj9vgid480w3sq8lfsl65azizx0fj-gfortran-wrapper-13.2.0/bin/gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Check for working Fortran compiler: /nix/store/jm9dj9vgid480w3sq8lfsl65azizx0fj-gfortran-wrapper-13.2.0/bin/gfortran - skipped
-- Building OpenCoarrays version: 2.10.2
-- Building for target architecture: x86_64
-- Performing Test Check_Simple_Coarray_Fortran_Source_Compiles
-- Performing Test Check_Simple_Coarray_Fortran_Source_Compiles - Success
-- Found MPI_C: /nix/store/fj1iwxc7qc3dp077p80v9aq06961ly5h-mpich-4.2.1/lib/libmpi.so (found version "4.1")
-- Found MPI_Fortran: /nix/store/fj1iwxc7qc3dp077p80v9aq06961ly5h-mpich-4.2.1/lib/libmpifort.so (found version "4.1")
-- Found MPI: TRUE (found version "4.1")
-- MPI runtime and compile time environments appear to be consistent
-- Performing Test MPI_C_COMPILES
-- Performing Test MPI_C_COMPILES - Success
-- Performing Test MPI_Fortran_MODULE_COMPILES
-- Performing Test MPI_Fortran_MODULE_COMPILES - Success
-- Performing Test MPI_Fortran_INCLUDE_COMPILES
-- Performing Test MPI_Fortran_INCLUDE_COMPILES - Success
-- Could NOT find Perl (missing: PERL_EXECUTABLE)
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Threads found? TRUE
-- Thread library to use:
-- Found threads library pthread compatible? 1
-- Looking for alloca.h
-- Looking for alloca.h - found
-- Looking for signal.h
-- Looking for signal.h - found
-- Looking for SIGKILL
-- Looking for SIGKILL - found
-- Looking for include files mpi.h, mpi-ext.h
-- Looking for include files mpi.h, mpi-ext.h - not found
-- Looking for MPIX_ERR_PROC_FAILED
-- Looking for MPIX_ERR_PROC_FAILED - found
-- Looking for MPIX_ERR_REVOKED
-- Looking for MPIX_ERR_REVOKED - found
-- Looking for MPIX_Comm_failure_ack
-- Looking for MPIX_Comm_failure_ack - found
-- Looking for MPIX_Comm_failure_get_acked
-- Looking for MPIX_Comm_failure_get_acked - found
-- Looking for MPIX_Comm_shrink
-- Looking for MPIX_Comm_shrink - found
-- Looking for MPIX_Comm_agree
-- Looking for MPIX_Comm_agree - found
-- The MPI implementation appears to have the experimental features for ULFM
that will allow you to build OpenCoarrays with failed images support. However,
ULFM support did not make it into the MPI-4 standard, and it is known to
trigger some bugs. Because of this we have disabled it by default. You may
add the `-DCAF_ENABLE_FAILED_IMAGES:BOOL=ON` CMake flag or edit the value
with ccmake or cmake-gui if you would like to experiment with failed images.
-- Looking for include file mpi.h
-- Looking for include file mpi.h - found
-- Looking for I_MPI_VERSION
-- Looking for I_MPI_VERSION - not found
-- Performing Test HAVE_ERROR_STOP_IN_PURE
-- Performing Test HAVE_ERROR_STOP_IN_PURE - Success
-- Performing Test HAVE_VARIABLE_STOP_CODE
-- Performing Test HAVE_VARIABLE_STOP_CODE - Success
-- Bash executable found: /nix/store/1xhds5s320nfp2022yjah1h7dpv8qqns-bash-5.2p32/bin/bash
-- Configuring done (5.9s)
-- Generating done (0.1s)
CMake Warning:
Manually-specified variables were not used by the project:
BUILD_TESTING
CMAKE_CXX_COMPILER
CMAKE_EXPORT_NO_PACKAGE_REGISTRY
CMAKE_POLICY_DEFAULT_CMP0025
-- Build files have been written to: /build/source/build
cmake: enabled parallel building
cmake: enabled parallel installing
Running phase: buildPhase
build flags: -j12 SHELL=/nix/store/1xhds5s320nfp2022yjah1h7dpv8qqns-bash-5.2p32/bin/bash
[ 1%] Building C object src/runtime-libraries/mpi/CMakeFiles/caf_mpi.dir/mpi_caf.c.o
[ 3%] Building C object src/runtime-libraries/mpi/CMakeFiles/caf_mpi_static.dir/__/common/caf_auxiliary.c.o
[ 3%] Building C object src/runtime-libraries/mpi/CMakeFiles/caf_mpi_static.dir/mpi_caf.c.o
[ 4%] Building C object src/runtime-libraries/mpi/CMakeFiles/caf_mpi.dir/__/common/caf_auxiliary.c.o
[ 5%] Building Fortran object src/tests/utilities/CMakeFiles/oc_test_interfaces.dir/oc_assertions_interface.F90.o
[ 6%] Building Fortran object src/tests/utilities/CMakeFiles/oc_test_interfaces.dir/opencoarrays_object_interface.f90.o
Error copying Fortran module "/nix/store/19ansk9r29rfji1ar10rjwmpgc61gxlk-OpenCoarrays-2.10.2/include/OpenCoarrays-2.10.2_GNU-13.2.0/oc_assertions_interface.mod". Tried "/nix/store/19ansk9r29rfji1ar10rjwmpgc61gxlk-OpenCoarrays-2.10.2/include/OpenCoarrays-2.10.2_GNU-13.2.0/OC_ASSERTIONS_INTERFACE.mod" and "/nix/store/19ansk9r29rfji1ar10rjwmpgc61gxlk-OpenCoarrays-2.10.2/include/OpenCoarrays-2.10.2_GNU-13.2.0/oc_assertions_interface.mod".
make[2]: *** [src/tests/utilities/CMakeFiles/oc_test_interfaces.dir/depend.make:7: src/tests/utilities/CMakeFiles/oc_test_interfaces.dir/oc_assertions_interface.mod.stamp] Error 1
make[2]: *** Waiting for unfinished jobs....
Error copying Fortran module "/nix/store/19ansk9r29rfji1ar10rjwmpgc61gxlk-OpenCoarrays-2.10.2/include/OpenCoarrays-2.10.2_GNU-13.2.0/opencoarrays_object_interface.mod". Tried "/nix/store/19ansk9r29rfji1ar10rjwmpgc61gxlk-OpenCoarrays-2.10.2/include/OpenCoarrays-2.10.2_GNU-13.2.0/OPENCOARRAYS_OBJECT_INTERFACE.mod" and "/nix/store/19ansk9r29rfji1ar10rjwmpgc61gxlk-OpenCoarrays-2.10.2/include/OpenCoarrays-2.10.2_GNU-13.2.0/opencoarrays_object_interface.mod".
make[2]: *** [src/tests/utilities/CMakeFiles/oc_test_interfaces.dir/depend.make:13: src/tests/utilities/CMakeFiles/oc_test_interfaces.dir/opencoarrays_object_interface.mod.stamp] Error 1
make[1]: *** [CMakeFiles/Makefile2:836: src/tests/utilities/CMakeFiles/oc_test_interfaces.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 7%] Linking Fortran shared library ../../../nix/store/19ansk9r29rfji1ar10rjwmpgc61gxlk-OpenCoarrays-2.10.2/lib/libcaf_mpi.so
[ 8%] Linking C static library ../../../nix/store/19ansk9r29rfji1ar10rjwmpgc61gxlk-OpenCoarrays-2.10.2/lib/libcaf_mpi.a
[ 8%] Built target caf_mpi_static
Creating symlink /nix/store/19ansk9r29rfji1ar10rjwmpgc61gxlk-OpenCoarrays-2.10.2/include/opencoarrays.mod --> /nix/store/19ansk9r29rfji1ar10rjwmpgc61gxlk-OpenCoarrays-2.10.2/include/OpenCoarrays-2.10.2_GNU-13.2.0/opencoarrays.mod
[ 8%] Built target caf_mpi
make: *** [Makefile:146: all] Error 2
error: builder for '/nix/store/xx8qd2k7vsri5dfjdcfwfw0rqdimfgdb-OpenCoarrays-2.10.2.drv' failed with exit code 2;
last 10 log lines:
> Error copying Fortran module "/nix/store/19ansk9r29rfji1ar10rjwmpgc61gxlk-OpenCoarrays-2.10.2/include/OpenCoarrays-2.10.2_GNU-13.2.0/opencoarrays_object_interface.mod". Tried "/nix/store/19ansk9r29rfji1ar10rjwmpgc61gxlk-OpenCoarrays-2.10.2/include/OpenCoarrays-2.10.2_GNU-13.2.0/OPENCOARRAYS_OBJECT_INTERFACE.mod" and "/nix/store/19ansk9r29rfji1ar10rjwmpgc61gxlk-OpenCoarrays-2.10.2/include/OpenCoarrays-2.10.2_GNU-13.2.0/opencoarrays_object_interface.mod".
> make[2]: *** [src/tests/utilities/CMakeFiles/oc_test_interfaces.dir/depend.make:13: src/tests/utilities/CMakeFiles/oc_test_interfaces.dir/opencoarrays_object_interface.mod.stamp] Error 1
> make[1]: *** [CMakeFiles/Makefile2:836: src/tests/utilities/CMakeFiles/oc_test_interfaces.dir/all] Error 2
> make[1]: *** Waiting for unfinished jobs....
> [ 7%] Linking Fortran shared library ../../../nix/store/19ansk9r29rfji1ar10rjwmpgc61gxlk-OpenCoarrays-2.10.2/lib/libcaf_mpi.so
> [ 8%] Linking C static library ../../../nix/store/19ansk9r29rfji1ar10rjwmpgc61gxlk-OpenCoarrays-2.10.2/lib/libcaf_mpi.a
> [ 8%] Built target caf_mpi_static
> Creating symlink /nix/store/19ansk9r29rfji1ar10rjwmpgc61gxlk-OpenCoarrays-2.10.2/include/opencoarrays.mod --> /nix/store/19ansk9r29rfji1ar10rjwmpgc61gxlk-OpenCoarrays-2.10.2/include/OpenCoarrays-2.10.2_GNU-13.2.0/opencoarrays.mod
> [ 8%] Built target caf_mpi
> make: *** [Makefile:146: all] Error 2
For full logs, run 'nix log /nix/store/xx8qd2k7vsri5dfjdcfwfw0rqdimfgdb-OpenCoarrays-2.10.2.drv'.
Now, I know that including cmake in the native build inputs does some ‘magic’, and since the above manual steps worked, I tried next to re-do these steps in the build process:
# build.nix
{
cmake,
gfortran,
mpich,
stdenv,
fetchFromGitHub,
}:
stdenv.mkDerivation rec {
pname = "OpenCoarrays";
version = "2.10.2";
src = fetchFromGitHub {
owner = "sourceryinstitute";
repo = "OpenCoarrays";
rev = version;
hash = "sha256-Go5PQQRC9OChRY37ShhCYyLo7tWSI3gwoo6pTSXyG9A=";
};
nativeBuildInputs = [
cmake
gfortran
];
buildInputs = [
mpich
];
dontUseCmakeConfigure = true;
buildPhase = ''
mkdir build && cd build
cmake ..
make
'';
installPhase = ''
mkdir -p $out/bin $out/lib64
cp bin/caf $out/bin/caf
cp bin/cafrun $out/bin/cafrun
cp -r lib64 $out/lib64
ln -s $out/lib64 $out/lib
'';
}
which got me a little bit further: the fortran module which caused issues earlier is found, but this time a different file is not being found by the appropriate executable (caf
in this case, a gfortran
wrapper). Again the output is below.
Summary
this derivation will be built:
/nix/store/hr7csgq6rdanxz2504c8w71fc59iq8kj-OpenCoarrays-2.10.2.drv
building '/nix/store/hr7csgq6rdanxz2504c8w71fc59iq8kj-OpenCoarrays-2.10.2.drv'...
Running phase: unpackPhase
unpacking source archive /nix/store/sg83g0y78m5n6plqyg46bib5ya5ad1pi-source
source root is source
Running phase: patchPhase
Running phase: updateAutotoolsGnuConfigScriptsPhase
Running phase: configurePhase
no configure script, doing nothing
Running phase: buildPhase
-- ------------------------------------------------------------------------------- --
_/_/
_/ _/ _/_/_/ _/_/ _/_/_/
_/ _/ _/ _/ _/_/_/_/ _/ _/
_/ _/ _/ _/ _/ _/ _/
_/_/ _/_/_/ _/_/_/ _/ _/
_/
_/
_/_/_/
_/ _/_/ _/_/_/ _/ _/_/ _/ _/_/ _/_/_/ _/ _/ _/_/_/
_/ _/ _/ _/ _/ _/_/ _/_/ _/ _/ _/ _/ _/_/
_/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/_/
_/_/_/ _/_/ _/_/_/ _/ _/ _/_/_/ _/_/_/ _/_/_/
_/
_/_/
OpenCoarrays
""""""""""""
Build Type: Release
Version: 2.10.2
-- ------------------------------------------------------------------------------ --
-- Running with CMake from: /nix/store/28s979fhz8d6h1rny3n5zh1ybmby6kjz-cmake-3.29.2/bin/cmake
-- Current source dir (for OpenCoarrays): /build/source
-- The C compiler identification is GNU 13.2.0
-- The Fortran compiler identification is GNU 13.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /nix/store/jm9dj9vgid480w3sq8lfsl65azizx0fj-gfortran-wrapper-13.2.0/bin/gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Check for working Fortran compiler: /nix/store/jm9dj9vgid480w3sq8lfsl65azizx0fj-gfortran-wrapper-13.2.0/bin/gfortran - skipped
-- Building OpenCoarrays version: 2.10.2
-- Building for target architecture: x86_64
-- Performing Test Check_Simple_Coarray_Fortran_Source_Compiles
-- Performing Test Check_Simple_Coarray_Fortran_Source_Compiles - Success
-- Found MPI_C: /nix/store/fj1iwxc7qc3dp077p80v9aq06961ly5h-mpich-4.2.1/lib/libmpi.so (found version "4.1")
-- Found MPI_Fortran: /nix/store/fj1iwxc7qc3dp077p80v9aq06961ly5h-mpich-4.2.1/lib/libmpifort.so (found version "4.1")
-- Found MPI: TRUE (found version "4.1")
-- MPI runtime and compile time environments appear to be consistent
-- Performing Test MPI_C_COMPILES
-- Performing Test MPI_C_COMPILES - Success
-- Performing Test MPI_Fortran_MODULE_COMPILES
-- Performing Test MPI_Fortran_MODULE_COMPILES - Success
-- Performing Test MPI_Fortran_INCLUDE_COMPILES
-- Performing Test MPI_Fortran_INCLUDE_COMPILES - Success
-- Could NOT find Perl (missing: PERL_EXECUTABLE)
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Threads found? TRUE
-- Thread library to use:
-- Found threads library pthread compatible? 1
-- Looking for alloca.h
-- Looking for alloca.h - found
-- Looking for signal.h
-- Looking for signal.h - found
-- Looking for SIGKILL
-- Looking for SIGKILL - found
-- Looking for include files mpi.h, mpi-ext.h
-- Looking for include files mpi.h, mpi-ext.h - not found
-- Looking for MPIX_ERR_PROC_FAILED
-- Looking for MPIX_ERR_PROC_FAILED - found
-- Looking for MPIX_ERR_REVOKED
-- Looking for MPIX_ERR_REVOKED - found
-- Looking for MPIX_Comm_failure_ack
-- Looking for MPIX_Comm_failure_ack - found
-- Looking for MPIX_Comm_failure_get_acked
-- Looking for MPIX_Comm_failure_get_acked - found
-- Looking for MPIX_Comm_shrink
-- Looking for MPIX_Comm_shrink - found
-- Looking for MPIX_Comm_agree
-- Looking for MPIX_Comm_agree - found
-- The MPI implementation appears to have the experimental features for ULFM
that will allow you to build OpenCoarrays with failed images support. However,
ULFM support did not make it into the MPI-4 standard, and it is known to
trigger some bugs. Because of this we have disabled it by default. You may
add the `-DCAF_ENABLE_FAILED_IMAGES:BOOL=ON` CMake flag or edit the value
with ccmake or cmake-gui if you would like to experiment with failed images.
-- Looking for include file mpi.h
-- Looking for include file mpi.h - found
-- Looking for I_MPI_VERSION
-- Looking for I_MPI_VERSION - not found
-- Performing Test HAVE_ERROR_STOP_IN_PURE
-- Performing Test HAVE_ERROR_STOP_IN_PURE - Success
-- Performing Test HAVE_VARIABLE_STOP_CODE
-- Performing Test HAVE_VARIABLE_STOP_CODE - Success
-- Bash executable found: /nix/store/1xhds5s320nfp2022yjah1h7dpv8qqns-bash-5.2p32/bin/bash
-- Configuring done (5.7s)
-- Generating done (0.1s)
-- Build files have been written to: /build/source/build
[ 1%] Building C object src/runtime-libraries/mpi/CMakeFiles/caf_mpi_static.dir/mpi_caf.c.o
[ 2%] Building C object src/runtime-libraries/mpi/CMakeFiles/caf_mpi_static.dir/__/common/caf_auxiliary.c.o
[ 3%] Linking C static library ../../../lib64/libcaf_mpi.a
[ 3%] Built target caf_mpi_static
[ 4%] Building Fortran object src/runtime-libraries/mpi/CMakeFiles/opencoarrays_mod.dir/opencoarrays.F90.o
[ 5%] Linking Fortran static library ../../../lib64/libopencoarrays_mod.a
[ 5%] Built target opencoarrays_mod
[ 6%] Building C object src/runtime-libraries/mpi/CMakeFiles/caf_mpi.dir/mpi_caf.c.o
[ 7%] Building C object src/runtime-libraries/mpi/CMakeFiles/caf_mpi.dir/__/common/caf_auxiliary.c.o
[ 8%] Linking Fortran shared library ../../../lib64/libcaf_mpi.so
Creating symlink include/opencoarrays.mod --> include/OpenCoarrays-2.10.2_GNU-13.2.0/opencoarrays.mod
[ 8%] Built target caf_mpi
[ 9%] Building Fortran object src/tests/utilities/CMakeFiles/oc_test_interfaces.dir/oc_assertions_interface.F90.o
[ 10%] Building Fortran object src/tests/utilities/CMakeFiles/oc_test_interfaces.dir/opencoarrays_object_interface.f90.o
[ 10%] Built target oc_test_interfaces
[ 11%] Building Fortran object src/tests/utilities/CMakeFiles/opencoarrays_test_utilities.dir/oc_assertions_implementation.F90.o
[ 12%] Linking Fortran static library ../../../lib64/libopencoarrays_test_utilities.a
[ 12%] Built target opencoarrays_test_utilities
[ 13%] Generating hello_multiverse
[ 13%] Built target build_hello_multiverse
[ 14%] Generating coarray_distributed_transpose
[ 14%] Built target build_coarray_distributed_transpose
[ 15%] Building Fortran object src/tests/integration/pde_solvers/coarrayBurgers/CMakeFiles/coarray_burgers_pde.dir/library/co_object_interface.F90.o
/bin/sh: /build/source/build/bin/caf: not found
make[2]: *** [src/tests/integration/pde_solvers/coarrayBurgers/CMakeFiles/coarray_burgers_pde.dir/build.make:140: src/tests/integration/pde_solvers/coarrayBurgers/CMakeFiles/coarray_burgers_pde.dir/library/co_object_interface.F90.o] Error 127
make[1]: *** [CMakeFiles/Makefile2:944: src/tests/integration/pde_solvers/coarrayBurgers/CMakeFiles/coarray_burgers_pde.dir/all] Error 2
make: *** [Makefile:146: all] Error 2
error: builder for '/nix/store/hr7csgq6rdanxz2504c8w71fc59iq8kj-OpenCoarrays-2.10.2.drv' failed with exit code 2;
last 10 log lines:
> [ 12%] Built target opencoarrays_test_utilities
> [ 13%] Generating hello_multiverse
> [ 13%] Built target build_hello_multiverse
> [ 14%] Generating coarray_distributed_transpose
> [ 14%] Built target build_coarray_distributed_transpose
> [ 15%] Building Fortran object src/tests/integration/pde_solvers/coarrayBurgers/CMakeFiles/coarray_burgers_pde.dir/library/co_object_interface.F90.o
> /bin/sh: /build/source/build/bin/caf: not found
> make[2]: *** [src/tests/integration/pde_solvers/coarrayBurgers/CMakeFiles/coarray_burgers_pde.dir/build.make:140: src/tests/integration/pde_solvers/coarrayBurgers/CMakeFiles/coarray_burgers_pde.dir/library/co_object_interface.F90.o] Error 127
> make[1]: *** [CMakeFiles/Makefile2:944: src/tests/integration/pde_solvers/coarrayBurgers/CMakeFiles/coarray_burgers_pde.dir/all] Error 2
> make: *** [Makefile:146: all] Error 2
For full logs, run 'nix log /nix/store/hr7csgq6rdanxz2504c8w71fc59iq8kj-OpenCoarrays-2.10.2.drv'.
I suspect (hope) these issues are similar and caused by me forgetting to set some path environment variable, but I wouldn’t know.
Worse, I don’t know how to reproduce this error: if I run nix-build --keep-failed
, and check the exact line in the generated makefiles that failed, and run this line manually (generating path/to/coarray_burgers_pde.dir/library/co_object_interface.F90.o
), it works fine.
Summary
(the line in question is:
cd /build/source/build/src/tests/integration/pde_solvers/coarrayBurgers && /build/source/build/bin/caf $(Fortran_DEFINES) $(Fortran_INCLUDES) $(Fortra n_FLAGS) -c /build/source/src/tests/integration/pde_solvers/coarrayBurgers/libr ary/co_object_interface.F90 -o CMakeFiles/coarray_burgers_pde.dir/library/co_ob ject_interface.F90.o
but with the /tmp/...
paths added in front)
In my understanding, the nix builder works in some special environment, and I’m wondering if there is a way for me to debug, or step through, the build process, while inside this environment.
What I assumed would be similar environments (the build files in /tmp
, or the nix-shell --pure
from the beginning) don’t fail, while the builder does.
Also, if I’m doing something very obviously wrong: what is it?
Thanks.
System information:
NixOS 24.05, Nix 2.18.5, Linux x86_64