Skip to content

Commit

Permalink
# This is a combination of 15 commits.
Browse files Browse the repository at this point in the history
# This is the 1st commit message:

Add recipe for the trlib C++ library
# The commit message #2 will be skipped:

# Update meta.yaml

# The commit message conda-forge#3 will be skipped:

# Update meta.yaml

# The commit message conda-forge#4 will be skipped:

# Update meta.yaml

# The commit message conda-forge#5 will be skipped:

# Create disable_valgrind.patch

# The commit message conda-forge#6 will be skipped:

# Update meta.yaml

# The commit message conda-forge#7 will be skipped:

# Remove dependency on C++ compiler

# The commit message conda-forge#8 will be skipped:

# Update 23.patch

# The commit message conda-forge#9 will be skipped:

# Update 23.patch

# The commit message conda-forge#10 will be skipped:

# Delete recipes/trlib/23.patch

# The commit message conda-forge#11 will be skipped:

# Create 23.patch

# The commit message conda-forge#12 will be skipped:

# Update build.sh

# The commit message conda-forge#13 will be skipped:

# Create win_fix.patch

# The commit message conda-forge#14 will be skipped:

# Update meta.yaml

# The commit message conda-forge#15 will be skipped:

# Update win_fix.patch
  • Loading branch information
traversaro committed Sep 16, 2023
1 parent b4e6812 commit b0c11bb
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 7 deletions.
54 changes: 54 additions & 0 deletions recipes/trlib/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
{% set name = "libtrlib" %}
{% set version = "0.4" %}

Expand Down Expand Up @@ -257,3 +258,56 @@ extra:
recipe-maintainers:
- traversaro
>>>>>>> d9c57bce94 (Remove dependency on C++ compiler)
=======
{% set name = "libtrlib" %}
{% set version = "0.4" %}

package:
name: {{ name }}
version: {{ version }}

source:
- url: https://github.com/felixlen/trlib/archive/refs/tags/{{ version }}.tar.gz
sha256: a4bf29598fe6a127188e2675b5600eeb5ca0e77413c7f745eb353a9ddb6b0119
patches:
- 23.patch
- disable_valgrind.patch
- win_fix.patch

build:
number: 0
run_exports:
- {{ pin_subpackage(name, max_pin='x.x') }}

requirements:
build:
- {{ compiler('c') }}
- cmake
- pkg-config
- ninja
host:
- libblas
- liblapack
- check # [not win]

test:
commands:
- test -f $PREFIX/lib/cmake/trlib/trlib-config.cmake # [unix]
- test -f $PREFIX/include/trlib.h # [unix]
- test -f $PREFIX/lib/libtrlib${SHLIB_EXT} # [unix]
- if not exist %PREFIX%\\Library\\lib\\cmake\\trlib\\trlib-config.cmake exit 1 # [win]
- if not exist %LIBRARY_INC%\\trlib.h exit 1 # [win]
- if not exist %LIBRARY_LIB%\\trlib.lib exit 1 # [win]
- if not exist %LIBRARY_BIN%\\trlib.dll exit 1 # [win]

about:
home: https://github.com/felixlen/trlib
license: MIT
license_file: LICENSE
summary: Trust Region Subproblem Solver Library

extra:
feedstock-name: trlib
recipe-maintainers:
- traversaro
>>>>>>> ba607f50f7 (Update meta.yaml)
32 changes: 25 additions & 7 deletions recipes/trlib/win_fix.patch
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
From 55b482cf34a64a0de9c1425e80fcc0bec2f1f67f Mon Sep 17 00:00:00 2001
From: Silvio Traversaro <silvio@traversaro.it>
Date: Sat, 16 Sep 2023 12:35:43 +0200
Subject: [PATCH] Do not link m library on Windows
From 147fd5adfd339bb3efb7eee21acf0bdb6f3d6c2d Mon Sep 17 00:00:00 2001
From: Silvio Traversaro <silvio.traversaro@iit.it>
Date: Sat, 16 Sep 2023 15:25:05 +0200
Subject: [PATCH] Fix compilation on Windows

---
src/CMakeLists.txt | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
src/CMakeLists.txt | 13 +++++++++++--
tests/CMakeLists.txt | 2 +-
2 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index c7e6aac..cafc2d7 100644
index c7e6aac..4f13c3a 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -31,7 +31,10 @@ target_include_directories(trlib
Expand All @@ -23,3 +24,20 @@ index c7e6aac..cafc2d7 100644
set_property(TARGET trlib PROPERTY C_STANDARD 11)

add_library("trlib::trlib" ALIAS trlib)
@@ -40,9 +43,15 @@ if(APPLE)
set_property(TARGET trlib PROPERTY INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib")
endif(APPLE)

+if(MSVC)
+ set_property(TARGET trlib PROPERTY WINDOWS_EXPORT_ALL_SYMBOLS ON)
+endif()
+
install(TARGETS trlib
EXPORT trlib-config
- DESTINATION lib)
+ LIBRARY DESTINATION lib
+ ARCHIVE DESTINATION lib
+ RUNTIME DESTINATION bin)

install(EXPORT trlib-config
NAMESPACE "trlib::"

0 comments on commit b0c11bb

Please sign in to comment.