Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SuSiEx with a patch to make its Makefile portable to Apple Clang. #44131

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open
7 changes: 7 additions & 0 deletions recipes/susiex/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

mkdir -p $PREFIX/bin

cd src
make
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
make
make -j ${CPU_COUNT}

cp ../bin/SuSiEx $PREFIX/bin/SuSiEx
pettyalex marked this conversation as resolved.
Show resolved Hide resolved
49 changes: 49 additions & 0 deletions recipes/susiex/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{% set version = '1.1.0' %}

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

source:
url: https://github.com/getian107/SuSiEx/archive/refs/tags/v{{ version }}.tar.gz
sha256: b67dca665e05b1e2a715033c29ad1485b8b3408edcf758d6f5f31a3bd202662c
patches:
- portable_makefile.patch

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

requirements:
build:
- {{ compiler('cxx') }}
- make
- llvm-openmp # [osx]
- libgomp # [linux]

host:
- llvm-openmp # [osx]
- libgomp # [linux]

run:
- llvm-openmp # [osx]
- libgomp # [linux]
pettyalex marked this conversation as resolved.
Show resolved Hide resolved

test:
commands:
- SuSiEx

about:
home: https://github.com/getian107/SuSiEx
license: MIT
license_family: MIT
license_file: LICENSE
summary: 'SuSiEx is a C++ based command line tool that performs cross-ancestry
fine-mapping using GWAS summary statistics and LD reference panels'

extra:
identifiers:
- doi:10.1111/rssb.12388
recipe-maintainers:
- pettyalex
36 changes: 36 additions & 0 deletions recipes/susiex/portable_makefile.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
diff --git a/src/makefile b/src/makefile
index 2f32523..a5057a8 100644
--- a/src/makefile
+++ b/src/makefile
@@ -1,14 +1,28 @@
+CXXFLAGS=-O3 -Wall -Wextra
+LDFLAGS=-O3 -flto
+
all: SuSiEx

+UNAME_S := $(shell uname -s)
+
+ifeq ($(UNAME_S),Darwin)
+ CXXFLAGS+=-fopenmp
+ LDLIBS+=-fopenmp
+else
+ CXXFLAGS=-fopenmp
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this overwrites CXXFLAGS ? The earlier set -O3 -Wall -Wextra will be lost

+ LDFLAGS+=-fopenmp
+endif
+
SuSiEx: main.cpp data.o model.o
mkdir -p ../bin
- g++ main.cpp data.o model.o -o ../bin/SuSiEx -fopenmp
+ $(CXX) $(LDFLAGS) main.cpp data.o model.o -o ../bin/SuSiEx $(LDLIBS)

data.o: data.cpp data.hpp
- g++ -c data.cpp -fopenmp
+ $(CXX) $(CXXFLAGS) -c data.cpp

model.o: model.cpp model.hpp
- g++ -c model.cpp -fopenmp
+ $(CXX) $(CXXFLAGS) -c model.cpp

+.PHONY: clean
clean:
rm -rf *.o ../bin/SuSiEx