Skip to content

Commit

Permalink
testing flag cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
nikhar-abbas committed Dec 21, 2021
1 parent 4c31544 commit 6f29556
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,25 +84,26 @@ def build_extension(self, ext):
localdir = os.path.join(this_directory, 'ROSCO','install')
os.makedirs(localdir, exist_ok=True)

cmake_args = ['-DBUILD_SHARED_LIBS=OFF']
cmake_args += ['-DCMAKE_Fortran_FLAGS=-ffree-line-length-0']
cmake_args += ['-DCMAKE_INSTALL_PREFIX={}'.format(localdir)]

if platform.system() == 'Windows':
if "gfortran" in os.environ["FC"].lower():
cmake_args += ['-G', 'MinGW Makefiles']
elif self.compiler.compiler_type == 'msvc':
cmake_args += ['-DCMAKE_GENERATOR_PLATFORM=x64']
else:
raise ValueError("Unable to find the system's Fortran compiler.")
# cmake_args = ['-DBUILD_SHARED_LIBS=OFF']
# cmake_args += ['-DCMAKE_Fortran_FLAGS=-ffree-line-length-0']
# cmake_args += ['-DCMAKE_INSTALL_PREFIX={}'.format(localdir)]

# if platform.system() == 'Windows':
# if "gfortran" in os.environ["FC"].lower():
# cmake_args += ['-G', 'MinGW Makefiles']
# elif self.compiler.compiler_type == 'msvc':
# cmake_args += ['-DCMAKE_GENERATOR_PLATFORM=x64']
# else:
# raise ValueError("Unable to find the system's Fortran compiler.")

self.build_temp = os.path.join( os.path.dirname( os.path.realpath(__file__) ), 'ROSCO', 'build')
os.makedirs(localdir, exist_ok=True)
# Need fresh build directory for CMake
os.makedirs(self.build_temp, exist_ok=True)

self.spawn(['cmake', '-S', ext.sourcedir, '-B', self.build_temp] + cmake_args)
self.spawn(['cmake', '--build', self.build_temp, '--target', 'install', '--config', 'Release'])
# self.spawn(['cmake', '-S', ext.sourcedir, '-B', self.build_temp] + cmake_args)
self.spawn(['cmake', '-B', self.build_temp, os.path.join(this_directory, 'ROSCO')])
self.spawn(['cmake', '--build', self.build_temp, '--target', 'install'])



Expand Down

0 comments on commit 6f29556

Please sign in to comment.