# Error during installation (make): "unsafe srcdir value"

**URL:** <https://gromacs.bioexcel.eu/t/error-during-installation-make-unsafe-srcdir-value/439>\
**Category:** User discussions\
**Created:** [July 8, 2020, 5:18am UTC](https://gromacs.bioexcel.eu/t/error-during-installation-make-unsafe-srcdir-value/439 "2020-07-08T05:18:41Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![srshuken](https://avatars.discourse-cdn.com/v4/letter/s/ad7895/32.png) [@srshuken](https://gromacs.bioexcel.eu/u/srshuken)\
**Post date:** [July 8, 2020, 5:18am UTC](https://gromacs.bioexcel.eu/t/error-during-installation-make-unsafe-srcdir-value/439/1 "2020-07-08T05:18:41Z")

</div>

GROMACS version: 2020.2  
GROMACS modification: No  
Hello,  
I used gromacs on a cluster long ago, and need to use it again. I’m trying to install it on my Mac (macOS Catalina 10.15.5) and I have CMake and gcc 5.1 (although when I do “gcc --version” I can’t seem to see the actual version, might be the problem).

I extracted the tar.gz and made build/ and navigated into it, exactly as described in the installation guide.

Then when I do cmake, whether or not I include -DGMX\_BUILD\_OWN\_FFTW=ON -DREGRESSIONTEST\_DOWNLOAD=ON, I get some weird stuff but it still looks OK:

```auto

DN0a1e47a9:build stevenshuken$ cmake .. -DGMX_BUILD_OWN_FFTW=ON -DREGRESSIONTEST_DOWNLOAD=ON

-- Atomic operations not found

-- Atomic operations not found

CMake Warning at cmake/ThreadMPI.cmake:130 (message):

Atomic operations not found for this CPU+compiler combination. Thread

support will be unbearably slow: disable threads. Atomic operations should

work on all but the most obscure CPU+compiler combinations; if your system

is not obscure -- like, for example, x86 with gcc -- please contact the

developers.

Call Stack (most recent call first):

CMakeLists.txt:563 (tmpi_enable)

-- The GROMACS-managed build of FFTW 3 will configure with the following optimizations: 

-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE) 

-- Doxygen not found. Documentation targets will not be generated.

Downloading: http://gerrit.gromacs.org/download/regressiontests-2020.2.tar.gz

-- [download 100% complete]

-- [download 0% complete]

-- [download 1% complete]

-- [download 2% complete]

................

-- [download 98% complete]

-- [download 99% complete]

-- [download 100% complete]

-- Configuring done

-- Generating done

-- Build files have been written to: /Users/stevenshuken/Documents/Research/_Software and hardware/Gromacs/gromacs-2020.2/build

```

Then when I do “make” stuff goes seriously wrong:

```auto

DN0a1e47a9:build stevenshuken$ make

[1%] **Performing configure step for 'fftwBuild'**

checking for a BSD-compatible install... /usr/bin/install -c

checking whether build environment is sane... configure: error: unsafe srcdir value: '/Users/stevenshuken/Documents/Research/_Software and hardware/Gromacs/gromacs-2020.2/build/src/external/build-fftw/fftwBuild-prefix/src/fftwBuild'

make[2]: *** [src/external/build-fftw/fftwBuild-prefix/src/fftwBuild-stamp/fftwBuild-configure] Error 1

make[1]: *** [src/external/build-fftw/CMakeFiles/fftwBuild.dir/all] Error 2

make: *** [all] Error 2

```

I’ve scoured the internet and although someone on the old email list appears to once have had this problem, I couldn’t find the solution. Please help!! :)  
-Steven

---

<div class="post-metadata">

**Author:** ![Masrul](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/masrul/32/234_2.png) [@Masrul](https://gromacs.bioexcel.eu/u/Masrul)\
**Post date:** [July 8, 2020, 7:46am UTC](https://gromacs.bioexcel.eu/t/error-during-installation-make-unsafe-srcdir-value/439/2 "2020-07-08T07:46:21Z")

</div>

As you didn’t assign C/C++ compiler explicitly, I guess cmake picks clang/clang++ as your compiler. You can define C/C++ compiler explicitly. Also, consider to define the installation directory, it helps to avoid unnecessary **sudo** command. Try something like that,

```bash
cmake .. -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_INSTALL_PREFIX=/path/to/gromacs -DGMX_BUILD_OWN_FFTW=ON -DREGRESSIONTEST_DOWNLOAD=ON 

```

Regards,  
Masrul

---

<div class="post-metadata">

**Author:** ![srshuken](https://avatars.discourse-cdn.com/v4/letter/s/ad7895/32.png) [@srshuken](https://gromacs.bioexcel.eu/u/srshuken)\
**Post date:** [July 8, 2020, 4:35pm UTC](https://gromacs.bioexcel.eu/t/error-during-installation-make-unsafe-srcdir-value/439/3 "2020-07-08T16:35:24Z")

</div>

Ah, that makes sense. This seemed to make cmake perform without incident! But then when I run `make`, I get into trouble again… everything seems to go smoothly until the end of the output, which you can see below. When I run make check I see the same thing, and then when I try to run `gmx` or `which -a gmx` nothing happens. It looks like it might be trying to make a Windows version or something?

```
DN0a1e47a9:build stevenshuken$ make

**Scanning dependencies of target fftwBuild**

....
....
....

ld: symbol(s) not found for architecture x86_64

clang: **error:** linker command failed with exit code 1 (use -v to see invocation)

make[2]: *** [lib/libgromacs.5.0.0.dylib] Error 1

make[1]: *** [src/gromacs/CMakeFiles/libgromacs.dir/all] Error 2

make: *** [all] Error 2

DN0a1e47a9:build stevenshuken$ make check

**Scanning dependencies of target mdrun_objlib**....
....
....

ld: symbol(s) not found for architecture x86_64

clang: **error:** linker command failed with exit code 1 (use -v to see invocation)

make[2]: *** [lib/libgromacs.5.0.0.dylib] Error 1

make[1]: *** [src/gromacs/CMakeFiles/libgromacs.dir/all] Error 2

make: *** [all] Error 2

DN0a1e47a9:build stevenshuken$ source /usr/local/gromacs/bin/GMXRC

-bash: /usr/local/gromacs/bin/GMXRC: No such file or directory

DN0a1e47a9:build stevenshuken$ gmx

-bash: gmx: command not found

DN0a1e47a9:build stevenshuken$ which -a gmx

DN0a1e47a9:build stevenshuken$
```

---

<div class="post-metadata">

**Author:** ![srshuken](https://avatars.discourse-cdn.com/v4/letter/s/ad7895/32.png) [@srshuken](https://gromacs.bioexcel.eu/u/srshuken)\
**Post date:** [July 8, 2020, 4:38pm UTC](https://gromacs.bioexcel.eu/t/error-during-installation-make-unsafe-srcdir-value/439/4 "2020-07-08T16:38:52Z")

</div>

Ah, and I saw the same thing when I did `sudo make install` .

---

<div class="post-metadata">

**Author:** ![Masrul](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/masrul/32/234_2.png) [@Masrul](https://gromacs.bioexcel.eu/u/Masrul)\
**Post date:** [July 8, 2020, 6:34pm UTC](https://gromacs.bioexcel.eu/t/error-during-installation-make-unsafe-srcdir-value/439/5 "2020-07-08T18:34:39Z")

</div>

Does not look like you are using -DCMAKE\_INSTALL\_PREFIX

Please use a directory in your home or somewhere else. Don’t use /usr/ or /opt type directory

---

<div class="post-metadata">

**Author:** ![jalemkul](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/jalemkul/32/18_2.png) [@jalemkul](https://gromacs.bioexcel.eu/u/jalemkul)\
**Post date:** [July 8, 2020, 6:51pm UTC](https://gromacs.bioexcel.eu/t/error-during-installation-make-unsafe-srcdir-value/439/6 "2020-07-08T18:51:55Z")

</div>

@Masrul why not? The default for `-DCMAKE_INSTALL_PREFIX` is `/usr/local/gromacs` anyway. One can certainly install in `/usr/` with `sudo make install`.

---

<div class="post-metadata">

**Author:** ![Masrul](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/masrul/32/234_2.png) [@Masrul](https://gromacs.bioexcel.eu/u/Masrul)\
**Post date:** [July 8, 2020, 7:07pm UTC](https://gromacs.bioexcel.eu/t/error-during-installation-make-unsafe-srcdir-value/439/7 "2020-07-08T19:07:21Z")

</div>

Dr. Lemkul(@jalemkul ),

My original suggestion to problem is to explicitly assign C/C++ compiler, as macOS will pick Clang/Clang++ as compiler. Suggestion of using **-DCMAKE\_INSTALL\_PREFIX** was optional, yet I find it convenient. Thanks for indicating, I will be more careful in future while replying.

Sincerely,  
Masrul

---

<div class="post-metadata">

**Author:** ![srshuken](https://avatars.discourse-cdn.com/v4/letter/s/ad7895/32.png) [@srshuken](https://gromacs.bioexcel.eu/u/srshuken)\
**Post date:** [July 8, 2020, 7:25pm UTC](https://gromacs.bioexcel.eu/t/error-during-installation-make-unsafe-srcdir-value/439/8 "2020-07-08T19:25:35Z")

</div>

Masrul,  
Thanks for your reply. I did in fact use `-DCMAKE_INSTLL_PREFIX` when calling `cmake` and the directory was set to `/Users/stevenshuken/Documents/Research/_Software-and-hardware/Gromacs/`, which is where I have the `gromacs-2020.2.tar.gz` and where the expanded `gromacs-2020.2` is. I will try setting `-DCMAKE_INSTLL_PREFIX` to something else in case that’s a problem.

---

<div class="post-metadata">

**Author:** ![srshuken](https://avatars.discourse-cdn.com/v4/letter/s/ad7895/32.png) [@srshuken](https://gromacs.bioexcel.eu/u/srshuken)\
**Post date:** [July 8, 2020, 7:41pm UTC](https://gromacs.bioexcel.eu/t/error-during-installation-make-unsafe-srcdir-value/439/9 "2020-07-08T19:41:09Z")

</div>

This is what happens:

```
DN0a1e47a9:build stevenshuken$ cmake .. -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_INSTALL_PREFIX=/Users/stevenshuken/Applications/ -DGMX_BUILD_OWN_FFTW=ON -DREGRESSIONTEST_DOWNLOAD=ON

-- The C compiler identification is AppleClang 11.0.3.11030032

-- The CXX compiler identification is AppleClang 11.0.3.11030032

-- Detecting C compiler ABI info

-- Detecting C compiler ABI info - done

-- Check for working C compiler: /usr/bin/gcc - skipped

-- Detecting C compile features

-- Detecting C compile features - done

-- Detecting CXX compiler ABI info

-- Detecting CXX compiler ABI info - done

-- Check for working CXX compiler: /usr/bin/g++ - skipped

-- Detecting CXX compile features

-- Detecting CXX compile features - done

-- Performing Test USING_LIBSTDCXX

-- Performing Test USING_LIBSTDCXX - Failed

-- Looking for NVIDIA GPUs present in the system

-- Could not detect NVIDIA GPUs

-- No compatible CUDA toolkit found (v5.0+), disabling native GPU acceleration

-- Could NOT find OpenMP_C (missing: OpenMP_C_FLAGS OpenMP_C_LIB_NAMES) 

-- Could NOT find OpenMP_CXX (missing: OpenMP_CXX_FLAGS OpenMP_CXX_LIB_NAMES) 

-- Could NOT find OpenMP (missing: OpenMP_C_FOUND OpenMP_CXX_FOUND) 

CMake Warning at cmake/gmxManageOpenMP.cmake:44 (message):

The compiler you are using does not support OpenMP parallelism. This might

hurt your performance a lot, in particular with GPUs. Try using a more

recent version, or a different compiler. For now, we are proceeding by

turning off OpenMP.

Call Stack (most recent call first):

CMakeLists.txt:319 (include)

```

…  
…  
…

```
-- [download 100% complete]

-- Configuring done

-- Generating done

-- Build files have been written to: /Users/stevenshuken/Documents/Research/_Software-and-hardware/Gromacs/gromacs-2020.2/build
```

---

<div class="post-metadata">

**Author:** ![srshuken](https://avatars.discourse-cdn.com/v4/letter/s/ad7895/32.png) [@srshuken](https://gromacs.bioexcel.eu/u/srshuken)\
**Post date:** [July 8, 2020, 8:03pm UTC](https://gromacs.bioexcel.eu/t/error-during-installation-make-unsafe-srcdir-value/439/10 "2020-07-08T20:03:20Z")

</div>

And then, with `make`:

```
DN0a1e47a9:build stevenshuken$ make

**Scanning dependencies of target fftwBuild**

[0%] **Creating directories for 'fftwBuild'**

[0%] **Performing download step (download, verify and extract) for 'fftwBuild'**

-- Downloading...

dst='/Users/stevenshuken/Documents/Research/_Software-and-hardware/Gromacs/gromacs-2020.2/build/src/external/build-fftw/fftwBuild-prefix/src/fftw-3.3.8.tar.gz'

timeout='none'

-- Using src='http://www.fftw.org/fftw-3.3.8.tar.gz'

-- [download 0% complete]

-- [download 1% complete]

-- [download 2% complete]

```

…  
…  
…

```
**Scanning dependencies of target gmx**

[98%] Building CXX object src/programs/CMakeFiles/gmx.dir/gmx.cpp.o

[98%] Building CXX object src/programs/CMakeFiles/gmx.dir/legacymodules.cpp.o

[98%] **Linking CXX executable ../../bin/gmx**

[98%] Built target gmx

**Scanning dependencies of target gmxapi**

[98%] Building CXX object src/api/cpp/CMakeFiles/gmxapi.dir/context.cpp.o

[98%] Building CXX object src/api/cpp/CMakeFiles/gmxapi.dir/exceptions.cpp.o

[98%] Building CXX object src/api/cpp/CMakeFiles/gmxapi.dir/gmxapi.cpp.o

[100%] Building CXX object src/api/cpp/CMakeFiles/gmxapi.dir/md.cpp.o

[100%] Building CXX object src/api/cpp/CMakeFiles/gmxapi.dir/mdmodule.cpp.o

[100%] Building CXX object src/api/cpp/CMakeFiles/gmxapi.dir/mdsignals.cpp.o

[100%] Building CXX object src/api/cpp/CMakeFiles/gmxapi.dir/session.cpp.o

[100%] Building CXX object src/api/cpp/CMakeFiles/gmxapi.dir/status.cpp.o

[100%] Building CXX object src/api/cpp/CMakeFiles/gmxapi.dir/system.cpp.o

[100%] Building CXX object src/api/cpp/CMakeFiles/gmxapi.dir/version.cpp.o

[100%] Building CXX object src/api/cpp/CMakeFiles/gmxapi.dir/workflow.cpp.o

[100%] Building CXX object src/api/cpp/CMakeFiles/gmxapi.dir/tpr.cpp.o

[100%] **Linking CXX shared library ../../../lib/libgmxapi.dylib**

[100%] Built target gmxapi

DN0a1e47a9:build stevenshuken$
```

---

<div class="post-metadata">

**Author:** ![Masrul](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/masrul/32/234_2.png) [@Masrul](https://gromacs.bioexcel.eu/u/Masrul)\
**Post date:** [July 8, 2020, 8:24pm UTC](https://gromacs.bioexcel.eu/t/error-during-installation-make-unsafe-srcdir-value/439/11 "2020-07-08T20:24:25Z")

</div>

@srshuken,  
It surprises me that cmake didn’t respect **-DCMAKE\_C\_COMPILER/-DCMAKE\_CXX\_COMPILER**. As your clang doesn’t have OpenMP support, that’s why you are seeing warnings. Due to lack of OpenMP support, gromacs will be slow. I am not sure, but it is worth trying to specify **CC** and **CXX** too,

```bash
CC=gcc CXX=g++ cmake .. -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_INSTALL_PREFIX=/Users/stevenshuken/Applications/ -DGMX_BUILD_OWN_FFTW=ON -DREGRESSIONTEST_DOWNLOAD=ON

```

It is also, worth noting, since macOS catalina, Apple made it very hard to use GNU compiler. I am using the academic version of the Intel compiler in the macOS Catalina to avoid all these hassles.

Sincerely,  
Masrul

---

<div class="post-metadata">

**Author:** ![srshuken](https://avatars.discourse-cdn.com/v4/letter/s/ad7895/32.png) [@srshuken](https://gromacs.bioexcel.eu/u/srshuken)\
**Post date:** [July 8, 2020, 9:17pm UTC](https://gromacs.bioexcel.eu/t/error-during-installation-make-unsafe-srcdir-value/439/12 "2020-07-08T21:17:08Z")

</div>

Masrul, thank you so much for your help. I may try to reinstall with OpenMP support, but the rest of the steps work and gromacs runs now! changing the install prefix worked. Since I am doing pretty small and short simulations hopefully it will be fine. Thanks again.
