Skip to content

Commit

Permalink
Merge pull request #65 from h-vetinari/activate
Browse files Browse the repository at this point in the history
Remove incompatible flags & add tests; tighten compiler-rt dep; add lld
  • Loading branch information
h-vetinari authored Aug 4, 2024
2 parents 9ef3d6c + dfaa843 commit ba62918
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
2 changes: 1 addition & 1 deletion recipe/activate.bat
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ set "FC=flang-new"
set "LD=lld-link.exe"

:: 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 -I%LIBRARY_INC%"
set "FFLAGS=-D_CRT_SECURE_NO_WARNINGS -fms-runtime-lib=dll -fuse-ld=lld -I%LIBRARY_INC%"
set "LDFLAGS=-nostdlib -Wl,-defaultlib:%CONDA_PREFIX:\=/%/lib/clang/@MAJOR_VER@/lib/windows/clang_rt.builtins-x86_64.lib"
2 changes: 0 additions & 2 deletions recipe/activate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@ export _OLD_FORTRANFLAGS=$FORTRANFLAGS
if [ -z "$CONDA_PREFIX" ]; then
export CPATH=$CPATH:$PREFIX/include
export LIBRARY_PATH=$LIBRARY_PATH:$PREFIX/lib
export FORTRANFLAGS="$FORTRANFLAGS -isystem ${CONDA_PREFIX}/include"
else
export CPATH=$CPATH:$CONDA_PREFIX/include
export LIBRARY_PATH=$LIBRARY_PATH:$CONDA_PREFIX/lib
export FORTRANFLAGS="$FORTRANFLAGS -isystem ${PREFIX}/include -fdebug-prefix-map=${SRC_DIR}=/usr/local/src/conda/${PKG_NAME}-${PKG_VERSION} -fdebug-prefix-map=${PREFIX}=/usr/local/src/conda-prefix"
export FORTRANFLAGS="$FORTRANFLAGS --sysroot=$CONDA_BUILD_SYSROOT"
fi

Expand Down
12 changes: 5 additions & 7 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ source:
sha256: 09c08693a9afd6236f27a2ebae62cda656eba19021ef3f94d59e931d662d4856

build:
number: 3
number: 4
# intentionally only windows (main target) & linux (debuggability)
skip: true # [osx]

Expand Down Expand Up @@ -47,10 +47,6 @@ outputs:
- compiler-rt =={{ version }}
- llvmdev =={{ version }}
- mlir =={{ version }}
run:
# necessary to link on windows (even for static lib), e.g.
# FortranDecimal.lib(binary-to-decimal.cpp.obj) : error LNK2019: unresolved external symbol __udivti3 ...
- compiler-rt =={{ version }} # [win]
test:
commands:
# shared lib on linux
Expand Down Expand Up @@ -109,7 +105,8 @@ outputs:
run:
- sysroot_{{ target_platform }} >={{ c_stdlib_version }} # [linux]
- clang =={{ version }}
- compiler-rt =={{ version }}
- compiler-rt =={{ version }} # [win]
- lld # [win]
- {{ pin_subpackage('libflang', exact=True) }}
- {{ pin_subpackage('libfortran-main', exact=True) }}
test:
Expand All @@ -123,7 +120,8 @@ outputs:
commands:
# see naming discussion: https://discourse.llvm.org/t/reviving-rename-flang-new-to-flang/68130/2
# - flang hello_world.f90
- flang-new hello_world.f90
- flang-new $FFLAGS hello_world.f90 # [unix]
- flang-new %FFLAGS% hello_world.f90 # [win]
- ./a.out # [unix]
- a.exe # [win]
# check if activation worked
Expand Down

0 comments on commit ba62918

Please sign in to comment.