这是indexloc提供的服务,不要输入任何密码
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions recipes/libtdlpack/bld.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

mkdir build
cd build

REM Make shared libs
cmake -G"Ninja" ^
%CMAKE_ARGS% ^
-DCMAKE_BUILD_TYPE=Release ^
-DCMAKE_PREFIX_PATH=%LIBRARY_PREFIX% ^
-DCMAKE_LIBRARY_PATH=%LIBRARY_LIB% ^
-DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% ^
-DCMAKE_FIND_FRAMEWORK=NEVER ^
-DCMAKE_FIND_APPBUNDLE=NEVER ^
-DBUILD_SHARED_LIBS=ON ^
-DBUILD_STATIC_LIBS=ON ^
%SRC_DIR%
if errorlevel 1 exit 1

REM Build step
cmake --build . --config Release
if errorlevel 1 exit 1

REM Install step
cmake --build . --config Release --target install
if errorlevel 1 exit 1
37 changes: 37 additions & 0 deletions recipes/libtdlpack/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/bash

set -ex # Abort on error.

declare -a CMAKE_PLATFORM_FLAGS
if [[ ${HOST} =~ .*darwin.* ]]; then
CMAKE_PLATFORM_FLAGS+=(-DCMAKE_OSX_SYSROOT="${CONDA_BUILD_SYSROOT}")
else
CMAKE_PLATFORM_FLAGS+=(-DCMAKE_TOOLCHAIN_FILE="${RECIPE_DIR}/cross-linux.cmake")
fi

echo "Building using ${PREFIX}"
echo "From ${PWD}"

mkdir build
cd build

# Make shared libs
cmake -G "${CMAKE_GENERATOR}" \
"${CMAKE_ARGS}" \
"${CMAKE_PLATFORM_FLAGS[@]}" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_PREFIX_PATH="${PREFIX}" \
-DCMAKE_INSTALL_PREFIX="${PREFIX}" \
-DCMAKE_INSTALL_LIBDIR=lib \
-DCMAKE_FIND_FRAMEWORK=NEVER \
-DCMAKE_FIND_APPBUNDLE=NEVER \
-DBUILD_SHARED_LIBS=ON \
-DBUILD_STATIC_LIBS=OFF \
"${SRC_DIR}"
make
make install

# Skip ctest when cross-compiling
#if [[ "${CONDA_BUILD_CROSS_COMPILATION:-}" != "1" || "${CROSSCOMPILING_EMULATOR:-}" != "" ]]; then
# ctest -VV --output-on-failure -j"${CPU_COUNT}" --exclude-from-file "tests-to-exclude.txt"
#fi
20 changes: 20 additions & 0 deletions recipes/libtdlpack/cross-linux.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# this one is important
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_PLATFORM Linux)
#this one not so much
set(CMAKE_SYSTEM_VERSION 1)

# specify the cross compiler
set(CMAKE_C_COMPILER $ENV{CC})

# where is the target environment
set(CMAKE_FIND_ROOT_PATH $ENV{PREFIX} $ENV{BUILD_PREFIX}/$ENV{HOST}/sysroot)

# search for programs in the build host directories
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# for libraries and headers in the target directories
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

# god-awful hack because it seems to not run correct tests to determine this:
set(__CHAR_UNSIGNED___EXITCODE 1)
49 changes: 49 additions & 0 deletions recipes/libtdlpack/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{% set name = "libtdlpack" %}
{% set version = "1.0.0" %}

package:
name: {{ name|lower }}
version: {{ version }}

source:
url: https://github.com/NOAA-MDL/libtdlpack/archive/refs/tags/v{{ version }}.tar.gz
sha256: c434c7f2cc5641a4924f323e0dd1f38b7120995922c3b43e75e5f414e891e326

build:
number: 0

requirements:
build:
- {{ compiler('fortran') }} # [not win]
- {{ compiler('c') }} # [not win]
- {{ stdlib("c") }} # [not win]
- make # [not win]
- {{ compiler('m2w64_fortran') }} # [win]
- {{ compiler('m2w64_c') }} # [win]
- {{ stdlib("m2w64_c") }} # [win]
- ninja # [win]
- cmake
- pkg-config >=0.21
host:
- libgomp # [linux]
- llvm-openmp # [osx]
- openmp ==5.0.0 # [win]
run:
- libgomp # [linux]
- llvm-openmp # [osx]
- openmp ==5.0.0 # [win]

test:
commands:
- test -f ${PREFIX}/lib/libtdlpack${SHLIB_EXT} # [not win]
- if not exist %LIBRARY_BIN%\\libtdlpack.dll exit 1 # [win]

about:
home: https://github.com/NOAA-MDL/libtdlpack
summary: libtdlpack is a Fortran library with C-bindings for reading and writing TDLPACK files.
license: MIT
license_file: LICENSE

extra:
recipe-maintainers:
- EricEngle-NOAA