Skip to content

Commit

Permalink
Merge pull request #62 from h-vetinari/activate
Browse files Browse the repository at this point in the history
Overhaul windows activation scripts
  • Loading branch information
h-vetinari authored Aug 2, 2024
2 parents 26d95ba + 8005097 commit f8438a6
Show file tree
Hide file tree
Showing 12 changed files with 61 additions and 24 deletions.
27 changes: 27 additions & 0 deletions .azure-pipelines/azure-pipelines-linux.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .azure-pipelines/azure-pipelines-win.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .ci_support/linux_64_.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ c_stdlib:
c_stdlib_version:
- '2.17'
cdt_name:
- cos6
- cos7
channel_sources:
- conda-forge
channel_targets:
Expand Down
1 change: 0 additions & 1 deletion .scripts/build_steps.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions build-locally.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions conda-forge.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
azure:
free_disk_space: true
settings_linux:
swapfile_size: 15GiB
settings_win:
variables:
SET_PAGEFILE: "True"
Expand Down
23 changes: 17 additions & 6 deletions recipe/activate.bat
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
set "_LIB=%LIB%"
set "_CPATH=%CPATH%"
setlocal enabledelayedexpansion

if "%CONDA_PREFIX%"=="" set "LIB=%LIB%;%PREFIX%\Library\lib"
if "%CONDA_PREFIX%"=="" set "CPATH=%CPATH%;%PREFIX%\Library\include"
set "_OLD_FC=%FC%"
set "_OLD_FFLAGS=%FFLAGS%"
set "_OLD_LD=%LD%"
set "_OLD_LDFLAGS=%LDFLAGS%"

if not "%CONDA_PREFIX%"=="" set "LIB=%LIB%;%CONDA_PREFIX%\Library\lib"
if not "%CONDA_PREFIX%"=="" set "CPATH=%CPATH%;%CONDA_PREFIX%\Library\include"
:: flang 18 still uses "temporary" name
set "FC=flang-new"
set "LD=lld-link.exe"

:: need to read clang version for path to compiler-rt
FOR /F "tokens=* USEBACKQ" %%F IN (`clang.exe -dumpversion`) DO (
SET "_CLANG_VER=%%F"
)

:: following https://github.com/conda-forge/clang-win-activation-feedstock/blob/main/recipe/activate-clang_win-64.bat
set "FFLAGS=-D_CRT_SECURE_NO_WARNINGS -nostdlib -fms-runtime-lib=dll -fuse-ld=lld -fno-aligned-allocation"
set "LDFLAGS=-nostdlib -Wl,-defaultlib:%CONDA_PREFIX:\=/%/lib/clang/!CLANG_VER:~0,2!/lib/windows/clang_rt.builtins-x86_64.lib"
2 changes: 1 addition & 1 deletion recipe/activate.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export _OLD_CPATH=$CPATH
export _OLD_FFLAGS=$FFLAGS
export _OLD_LIBRARY_PATH=$LIBRARY_PATH
export _OLD_FORTRANFLAGS=$FORTRANFLAGS

Expand All @@ -14,4 +15,3 @@ else
fi

export FFLAGS=$FORTRANFLAGS
export Fortran_FLAGS=$FORTRANFLAGS
2 changes: 0 additions & 2 deletions recipe/conda_build_config.yaml

This file was deleted.

6 changes: 4 additions & 2 deletions recipe/deactivate.bat
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
set "LIB=%_LIB%"
set "CPATH=%_CPATH%"
set "FC=%_OLD_FC%"
set "FFLAGS=%_OLD_FFLAGS%"
set "LD=%_OLD_LD%"
set "LDFLAGS=%_OLD_LDFLAGS%"
1 change: 1 addition & 0 deletions recipe/deactivate.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export CPATH=$_OLD_CPATH
export FFLAGS=$_OLD_FFLAGS
export FORTRANFLAGS=$_OLD_FORTRANFLAGS
export LIBRARY_PATH=$_OLD_LIBRARY_PATH
12 changes: 4 additions & 8 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@ source:
sha256: 09c08693a9afd6236f27a2ebae62cda656eba19021ef3f94d59e931d662d4856

build:
number: 1
number: 2
# intentionally only windows (main target) & linux (debuggability)
skip: true # [osx]
track_features:
- flang

requirements:
build:
Expand All @@ -34,10 +32,6 @@ requirements:
- mlir =={{ version }}
- zlib

test:
commands:
- flang --version

outputs:
- name: libflang
script: install_libflang.sh # [unix]
Expand Down Expand Up @@ -134,7 +128,9 @@ outputs:
- libflang >={{ version }}
requirements:
- {{ pin_subpackage('flang', exact=True) }}

test:
commands:
- echo "tested in other outputs"

about:
home: https://flang.llvm.org
Expand Down

0 comments on commit f8438a6

Please sign in to comment.