Skip to content

Commit

Permalink
use another way to pass var
Browse files Browse the repository at this point in the history
  • Loading branch information
CyanideCN committed Jul 10, 2023
1 parent c73056a commit 5750495
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
5 changes: 3 additions & 2 deletions download.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
def call_command(cmd):
return subprocess.run(cmd, shell=True, stdout=subprocess.PIPE)

print(os.getcwd())
call_command(['curl', '-o', 'sources.tar.gz', url])
call_command('7z x -tgzip -so sources.tar.gz | 7z x -si -ttar')
os.environ['ECCODES_SOURCE_DIR'] = dir_name

with open('ECCODES_SOURCE_DIR', 'w') as f:
f.write(dir_name)
9 changes: 6 additions & 3 deletions run_cmake.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,21 @@
import subprocess

cwd = os.getcwd()
build_path = os.path.join(cwd, os.environ['ECCODES_SOURCE_DIR'], 'build')
with open('ECCODES_SOURCE_DIR', 'r') as f:
source_dir = f.read().strip()
build_path = os.path.join(cwd, source_dir, 'build')
print(build_path)
os.makedirs(build_path)
os.chdir(build_path)
subprocess.call('cmake -G "NMake Makefiles"',
'-D CMAKE_INSTALL_PREFIX=${{ env.install_dir }}',
'-D CMAKE_INSTALL_PREFIX=C:\eccodes',
'-D CMAKE_BUILD_TYPE=Release',
'-D ENABLE_FORTRAN=0',
'-D ENABLE_PYTHON=0',
'-D ENABLE_NETCDF=0',
'-D ENABLE_PNG=1',
'-D ENABLE_JPG=1',
'-D OPENJPEG_INCLUDE_DIR=${{ env.conda_dir }}\Library\include\openjpeg-2.5.0',
'-D OPENJPEG_INCLUDE_DIR=C:\Miniconda\Library\include\openjpeg-2.5.0',
'-D IEEE_LE=1',
'-D ENABLE_EXAMPLES=0',
'-D ENABLE_MEMFS=0',
Expand Down

0 comments on commit 5750495

Please sign in to comment.