-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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 Reseek #51882
Merged
Merged
Add Reseek #51882
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
2b9a795
Add Reseek
apcamargo 3897e8c
Fix move command
apcamargo b4a97fa
Remove ARM support
apcamargo b91cc35
Change compiler
apcamargo 07fa300
Add `conda_build_config.yaml`
apcamargo 602d2ee
Add `{{ stdlib("c") }}`
apcamargo 92bfcab
Remove `{{ stdlib("c") }}`
apcamargo 1337df6
Update `conda_build_config.yaml`
apcamargo 6fb1b81
Update `conda_build_config.yaml`
apcamargo ab0f159
Update compiler
apcamargo 60fbea9
Try to add C compyler
apcamargo f4ba7a7
Skip OSX
apcamargo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
mkdir -p ${PREFIX}/bin | ||
cd src || exit 1 | ||
echo "0" > gitver.txt | ||
|
||
cp ${RECIPE_DIR}/vcxproj_make.py . | ||
chmod +x vcxproj_make.py | ||
./vcxproj_make.py --openmp --cppcompiler ${CXX} --ccompiler ${CC} | ||
|
||
# Verify binary exists and is executable | ||
if [ ! -f ../bin/reseek ]; then | ||
echo "Error: reseek binary not found" | ||
exit 1 | ||
fi | ||
|
||
cp ../bin/reseek ${PREFIX}/bin/reseek |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{% set name = "reseek" %} | ||
{% set version = "2.0.1" %} | ||
|
||
package: | ||
name: {{ name|lower }} | ||
version: {{ version }} | ||
|
||
source: | ||
url: https://github.com/rcedgar/reseek/archive/refs/tags/v{{ version }}.tar.gz | ||
sha256: 79a2aca249547a164ff7a6460abc6875c182a40693ac07068cc859b7cb7a95ec | ||
|
||
build: | ||
number: 0 | ||
skip: True #[osx] | ||
run_exports: | ||
- {{ pin_subpackage(name, max_pin="x.x") }} | ||
|
||
|
||
requirements: | ||
build: | ||
- {{ compiler("cxx") }} | ||
- {{ compiler("c") }} | ||
- make | ||
|
||
test: | ||
commands: | ||
- reseek -version | ||
about: | ||
home: https://github.com/rcedgar/reseek | ||
license: GPL-3.0-only | ||
license_file: LICENSE | ||
summary: Protein structure alignment and search algorithm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,225 @@ | ||
#!/usr/bin/env python | ||
|
||
import argparse | ||
import os | ||
import sys | ||
|
||
Usage = ( | ||
"Convert Visual Studio .vcxproj file in current directory to Makefile and run make." | ||
) | ||
|
||
AP = argparse.ArgumentParser(description=Usage) | ||
|
||
# Value opts | ||
AP.add_argument( | ||
"--std", | ||
required=False, | ||
help="C++ standard option for GCC, e.g. c++11 or c++17 (default none)", | ||
) | ||
AP.add_argument( | ||
"--cppcompiler", | ||
required=False, | ||
default="g++", | ||
help="C++ compiler command name default g++)", | ||
) | ||
AP.add_argument( | ||
"--ccompiler", | ||
required=False, | ||
default="gcc", | ||
help="C++ compiler command name default gcc)", | ||
) | ||
|
||
# Flag opts | ||
AP.add_argument("--debug", required=False, action="store_true", help="Debug build") | ||
AP.add_argument("--openmp", required=False, action="store_true", help="Requires OMP") | ||
AP.add_argument( | ||
"--pthread", required=False, action="store_true", help="Requires pthread" | ||
) | ||
AP.add_argument("--lrt", required=False, action="store_true", help="Requires lrt") | ||
AP.add_argument( | ||
"--symbols", | ||
required=False, | ||
action="store_true", | ||
help="Debug symbols (default if --debug)", | ||
) | ||
AP.add_argument( | ||
"--nostrip", | ||
required=False, | ||
action="store_true", | ||
help="Don't strip symbols (default if --debug or --symbols)", | ||
) | ||
|
||
Args = AP.parse_args() | ||
debug = Args.debug | ||
std = Args.std | ||
cppcompiler = Args.cppcompiler | ||
ccompiler = Args.ccompiler | ||
nostrip = debug or Args.symbols | ||
symbols = debug or Args.symbols | ||
|
||
ProjFileName = None | ||
HdrNames = [] | ||
for FileName in os.listdir("."): | ||
if FileName.endswith(".vcxproj"): | ||
ProjFileName = FileName | ||
elif FileName.endswith(".h"): | ||
HdrNames.append(FileName) | ||
if ProjFileName is None: | ||
sys.stderr.write("\nProject file not found in current directory\n") | ||
sys.exit(1) | ||
|
||
binary = ProjFileName.replace(".vcxproj", "") | ||
sys.stderr.write("binary=" + binary + "\n") | ||
|
||
compiler_opts = " -ffast-math -march=native" | ||
linker_opts = " -ffast-math -march=native" | ||
|
||
if std: | ||
compiler_opts += " --std=" + std | ||
|
||
if debug: | ||
compiler_opts += " -O0 -DDEBUG" | ||
linker_opts += " -O0" | ||
else: | ||
compiler_opts += " -O3 -DNDEBUG" | ||
linker_opts += " -O3" | ||
|
||
if symbols: | ||
compiler_opts += " -g3" | ||
linker_opts += " -g3" | ||
|
||
if Args.openmp: | ||
compiler_opts += " -fopenmp" | ||
linker_opts += " -fopenmp" | ||
|
||
if Args.pthread: | ||
compiler_opts += " -pthread" | ||
linker_opts += " -lpthread" | ||
|
||
rc = os.system(r"rm -rf o/ ../bin/%s*" % binary) | ||
if rc != 0: | ||
sys.stderr.write("\n\nERROR -- failed to clean\n\n") | ||
sys.exit(1) | ||
sys.stderr.write("clean done.\n") | ||
|
||
OBJDIR = "o" | ||
BINDIR = "../bin" | ||
|
||
Fields = ProjFileName.split("/") | ||
n = len(Fields) | ||
Name = Fields[n - 1] | ||
Fields = Name.split(".") | ||
binary = Fields[0] | ||
|
||
CXXNames = [] | ||
CNames = [] | ||
with open(ProjFileName) as File: | ||
for Line in File: | ||
Line = Line.strip() | ||
Line = Line.replace('"', "") | ||
Line = Line.replace(" ", "") | ||
# <ClCompile Include="betadiv.cpp" /> | ||
if Line.startswith("<ClCompileInclude"): | ||
Fields = Line.split("=") | ||
if len(Fields) != 2: | ||
continue | ||
FileName = Fields[1] | ||
FileName = FileName.replace("/>", "") | ||
if FileName.endswith(".cpp"): | ||
FileName = FileName.replace(".cpp", "") | ||
CXXNames.append(FileName) | ||
elif FileName.endswith(".c"): | ||
FileName = FileName.replace(".c", "") | ||
CNames.append(FileName) | ||
|
||
assert len(CXXNames) > 0 or len(CNames) > 0 | ||
|
||
with open("Makefile", "w") as f: | ||
|
||
def Out(s): | ||
print(s, file=f) | ||
|
||
BINPATH = "$(BINDIR)/%s" % (binary) | ||
|
||
Out("######################################################") | ||
Out("# Makefile is generated by " + sys.argv[0]) | ||
Out("# Don't edit the Makefile -- update the python script") | ||
Out("######################################################") | ||
Out("") | ||
Out("BINDIR := %s" % BINDIR) | ||
Out("OBJDIR := %s" % OBJDIR) | ||
Out("BINPATH := %s" % BINPATH) | ||
|
||
if CNames: | ||
Out("") | ||
Out("CC = " + ccompiler) | ||
Out("CFLAGS := $(CFLAGS) " + compiler_opts) | ||
|
||
if CXXNames: | ||
Out("") | ||
Out("CXX = " + cppcompiler) | ||
Out("CXXFLAGS := $(CFLAGS) " + compiler_opts) | ||
|
||
Out("") | ||
Out("UNAME_S := $(shell uname -s)") | ||
Out("LDFLAGS := $(LDFLAGS) " + linker_opts) | ||
Out("ifeq ($(UNAME_S),Linux)") | ||
Out(" LDFLAGS += -static") | ||
Out("endif") | ||
|
||
Out("") | ||
Out("HDRS = \\") | ||
for Name in sorted(HdrNames): | ||
Out(" %s \\" % Name) | ||
|
||
Out("") | ||
Out("OBJS = \\") | ||
for Name in CXXNames: | ||
Out(" $(OBJDIR)/%s.o \\" % (Name)) | ||
|
||
for Name in CNames: | ||
Out(" $(OBJDIR)/%s.o \\" % (Name)) | ||
|
||
Out("") | ||
Out(".PHONY: clean") | ||
|
||
Out("") | ||
Out("$(BINPATH) : $(BINDIR)/ $(OBJDIR)/ $(OBJS)") | ||
|
||
if len(CXXNames) > 0: | ||
Cmd = "\t$(CXX) $(LDFLAGS) $(OBJS) -o $(BINPATH)" | ||
else: | ||
Cmd = "\t%(CC) $(LDFLAGS) $(OBJS) -o $(BINPATH)" | ||
|
||
if Args.lrt: | ||
Cmd += " -lrt" | ||
Out(Cmd) | ||
|
||
if not nostrip: | ||
Out(" strip $(BINPATH)") | ||
|
||
Out("") | ||
Out("$(OBJDIR)/ :") | ||
Out(" mkdir -p $(OBJDIR)/") | ||
|
||
Out("") | ||
Out("$(BINDIR)/ :") | ||
Out(" mkdir -p $(BINDIR)/") | ||
|
||
if CNames: | ||
Out("") | ||
Out("$(OBJDIR)/%.o : %.c $(HDRS)") | ||
Out(" $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<") | ||
|
||
if CXXNames: | ||
Out("") | ||
Out("$(OBJDIR)/%.o : %.cpp $(HDRS)") | ||
Out(" $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $<") | ||
|
||
sys.stderr.write("Makefile done.\n") | ||
|
||
rc = os.system("make") | ||
if rc != 0: | ||
sys.stderr.write("\n\nERROR -- make failed\n\n") | ||
sys.exit(1) | ||
sys.stderr.write("make done.\n") |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where is this coming from? Maybe add a comment here, that this file needs to be kept in sync?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the author's own script. In his repository he downloads it at build time, but I decided to have it within the recipe to have more control over it. I'll add a comment.