# compile error

**URL:** https://openmc.discourse.group/t/compile-error/154
**Category:** User Support
**Created:** [June 14, 2015, 4:57am UTC](https://openmc.discourse.group/t/compile-error/154 "2015-06-14T04:57:23Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Jilang\_Miao](https://avatars.discourse-cdn.com/v4/letter/j/6f9a4e/32.png) [@Jilang\_Miao](https://openmc.discourse.group/u/Jilang_Miao)
#### Post date: [June 14, 2015, 4:57am UTC](https://openmc.discourse.group/t/compile-error/154/1 "2015-06-14T04:57:23Z")

</div>

Hello everyone,

I cannot compile openmc due to the following error:  
$make

Scanning dependencies of target fox\_fsys  
[1%] Building Fortran object xml/fox/fsys/CMakeFiles/fox\_fsys.dir/fox\_m\_fsys\_realtypes.f90.o  
[2%] Building Fortran object xml/fox/fsys/CMakeFiles/fox\_fsys.dir/fox\_m\_fsys\_abort\_flush.F90.o  
/home/jlmiao/openmc/src/xml/fox/fsys/fox\_m\_fsys\_abort\_flush.F90:107.30:

stop STDERR\_FAILURE\_STATUS  
1  
Error: Syntax error in STOP statement at (1)  
make[3]: \*\*\* [xml/fox/fsys/CMakeFiles/fox\_fsys.dir/fox\_m\_fsys\_abort\_flush.F90.o] Error 1  
make[2]: \*\*\* [xml/fox/fsys/CMakeFiles/fox\_fsys.dir/fox\_m\_fsys\_abort\_flush.F90.o.provides] Error 2  
make[1]: \*\*\* [xml/fox/fsys/CMakeFiles/fox\_fsys.dir/all] Error 2  
make: \*\*\* [all] Error 2

I find it’s because the f95 compiler is too old.  
$ f95 …/src/xml/fox/fsys/fox\_m\_fsys\_abort\_flush.F90 -c -o temp.o

…/src/xml/fox/fsys/fox\_m\_fsys\_abort\_flush.F90:107.30:

stop STDERR\_FAILURE\_STATUS  
1  
Error: Syntax error in STOP statement at (1)

My gfortran is up to date  
$ gfortran …/src/xml/fox/fsys/fox\_m\_fsys\_abort\_flush.F90 -c -o temp.o

But cmake chooses f95 by default, How can I change that to gfortan?

$ cmake …/src/  
– The Fortran compiler identification is GNU  
– Check for working Fortran compiler: /usr/bin/f95  
– Check for working Fortran compiler: /usr/bin/f95 – works  
– Detecting Fortran compiler ABI info  
– Detecting Fortran compiler ABI info - done  
– Checking whether /usr/bin/f95 supports Fortran 90  
– Checking whether /usr/bin/f95 supports Fortran 90 – yes  
– Found PythonInterp: /opt/python/2.7/bin/python (found version “2.7.3”)  
– Configuring done  
– Generating done  
– Build files have been written to: /home/jlmiao/openmc/build

Thanks!  
Jilang

---

<div class="post-metadata">

### Author: ![Sterling\_Harper](https://avatars.discourse-cdn.com/v4/letter/s/90ced4/32.png) [@Sterling\_Harper](https://openmc.discourse.group/u/Sterling_Harper)
#### Post date: [June 14, 2015, 5:00am UTC](https://openmc.discourse.group/t/compile-error/154/2 "2015-06-14T05:00:02Z")

</div>

You can force fortran by setting the FC environment variable. So run

> export FC=gfortran

before CMake
