diff --git a/build1.sh b/build1.sh index b971c33965..50ad3d165d 100755 --- a/build1.sh +++ b/build1.sh @@ -3,20 +3,36 @@ set -e set -x -mkdir -p ./build -cd build +SRCDIR=`pwd` +CMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH_LPYTHON;$CONDA_PREFIX" -cmake .. \ +# if we are in a pixi project, use the pixi "host" environment for the dependencies +if [[ ! -z $PIXI_PROJECT_ROOT ]]; then + CMAKE_PREFIX_PATH=$PIXI_PROJECT_ROOT/.pixi/envs/host/ + OUTOFTREE=false + + if [[ ! -f src/libasr/asr.h ]]; then + pixi run build_0 + fi +fi + +# if the outoftree env var is set to true, create a build directory +if [[ "$OUTOFTREE" == "true" ]]; then + mkdir -p build + cd build +fi + + +cmake $SRCDIR \ -GNinja \ -DCMAKE_BUILD_TYPE=Debug \ -DWITH_LLVM=yes \ -DLPYTHON_BUILD_ALL=yes \ -DWITH_STACKTRACE=yes \ -DWITH_RUNTIME_STACKTRACE=yes \ - -DWITH_INTRINSIC_MODULES=yes \ -DWITH_LSP=no \ -DWITH_LFORTRAN_BINARY_MODFILES=no \ - -DCMAKE_PREFIX_PATH="$PIXI_PROJECT_ROOT/.pixi/envs/host/" \ - -DCMAKE_INSTALL_PREFIX=`pwd`/inst \ + -DCMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH \ + -DCMAKE_INSTALL_PREFIX=`pwd`/inst -cmake --build . --target install +cmake --build . -j --target install diff --git a/ci/environment.yml b/ci/environment.yml index db5ded2261..7f858da8e9 100644 --- a/ci/environment.yml +++ b/ci/environment.yml @@ -18,5 +18,6 @@ dependencies: - zstd=1.5.6 - ninja=1.11.0 - rapidjson=1.1.0 + - ninja # - bison=3.4 [not win] # - m2-bison=3.4 [win] diff --git a/environment_unix.yml b/environment_unix.yml index af7dffcff0..01164f8d80 100644 --- a/environment_unix.yml +++ b/environment_unix.yml @@ -4,7 +4,7 @@ channels: dependencies: - git - pip - - make + - ninja - re2c - toml - zlib diff --git a/integration_tests/run_tests.py b/integration_tests/run_tests.py index e5df7cf909..0bdf78aba5 100755 --- a/integration_tests/run_tests.py +++ b/integration_tests/run_tests.py @@ -54,6 +54,7 @@ def main(): # Setup global DEFAULT_THREADS_TO_USE, fast_tests, python_libs_req + os.environ["PATH"] = LPYTHON_PATH + os.pathsep + os.environ["PATH"] # delete previously created directories (if any) for backend in SUPPORTED_BACKENDS: diff --git a/pixi.lock b/pixi.lock index 3f209e61a7..c81dbb6cf7 100644 --- a/pixi.lock +++ b/pixi.lock @@ -32,9 +32,11 @@ environments: - conda: https://conda.anaconda.org/conda-forge/osx-arm64/libedit-3.1.20191231-hc8eb9b7_2.tar.bz2 - conda: https://conda.anaconda.org/conda-forge/osx-arm64/libev-4.33-h93a5062_2.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/libexpat-2.6.2-hebf3989_0.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/libffi-3.4.2-h3422bc3_5.tar.bz2 - conda: https://conda.anaconda.org/conda-forge/osx-arm64/libiconv-1.17-h0d3ecfb_2.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/libllvm16-16.0.6-haab561b_3.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/libnghttp2-1.58.0-ha4dd798_1.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/libsqlite-3.46.0-hfb93653_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/libssh2-1.11.0-h7a5bd25_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/libuv-1.48.0-h93a5062_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/libxml2-2.12.7-ha661575_1.conda @@ -44,9 +46,14 @@ environments: - conda: https://conda.anaconda.org/conda-forge/osx-arm64/ncurses-6.5-hb89a1cb_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/ninja-1.12.1-h420ef59_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/openssl-3.3.1-hfb2fe0b_0.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/python-3.10.2-h38ef502_4_cpython.tar.bz2 + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/readline-8.2-h92ec313_1.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/rhash-1.4.4-hb547adb_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/sigtool-0.1.3-h44b9a77_0.tar.bz2 + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/sqlite-3.46.0-h5838104_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/tapi-1100.0.11-he4954df_0.tar.bz2 + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/tk-8.6.13-h5083fa2_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/tzdata-2024a-h0c530f3_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/xz-5.2.6-h57fd34a_0.tar.bz2 - conda: https://conda.anaconda.org/conda-forge/osx-arm64/zstd-1.5.6-hb46c0d2_0.conda default: diff --git a/pixi.toml b/pixi.toml index 033d21aef1..e2202acbb6 100644 --- a/pixi.toml +++ b/pixi.toml @@ -30,10 +30,13 @@ zstd-static = "1.5.5.*" cxx-compiler = "*" cmake = "*" ninja = "*" +python = "3.10.2.*" [feature.compiler.tasks] -build_1 = { cmd = "sh build1.sh", depends-on = ["build_0"] } +build_1 = { cmd = "sh build1.sh" } build = { depends-on = ["build_0", "build_1"] } +test = { cmd = "python ./integration_tests/run_tests.py"} + [environments] compiler = ["compiler"]