Git Product home page Git Product logo

Comments (9)

jerowe avatar jerowe commented on May 28, 2024

I created a patch to drop in gcc for clang.

Disregard this. Updated below.

from pheniqs.

jerowe avatar jerowe commented on May 28, 2024

New patch and errors.

--- Makefile    2018-04-22 10:21:13.000000000 +0400
+++ Makefile    2018-04-22 10:40:26.000000000 +0400
@@ -30,15 +30,17 @@
 MAJOR_REVISON := 1
 MINOR_REVISON := 1

-CC              = clang++
 PREFIX          = /usr/local
 BIN_PREFIX      = $(PREFIX)/bin
 INCLUDE_PREFIX  = $(PREFIX)/include
 LIB_PREFIX      = $(PREFIX)/lib

-CFLAGS          = -std=c++11 -O3 -Wall -Wsign-compare
-LDFLAGS         =
-LIBS            = -lhts -lz -lbz2 -llzma
+CFLAGS          += -std=c++11 -O3 -Wall -Wsign-compare
+LDFLAGS         +=
+LIBS            += -lhts -lz -lbz2 -llzma
+
+CFLAGS += -I$(INCLUDE_PREFIX)
+LDFLAGS += -L$(LIB_PREFIX)

 STATIC_LIBS = \
 $(LIB_PREFIX)/libhts.a \
@@ -94,11 +96,6 @@
        override PHENIQS_VERSION := $(PHENIQS_VERSION).$(PHENIQS_GIT_VERSION)
 endif

-ifdef PREFIX
-       CFLAGS += -I$(INCLUDE_PREFIX)
-       LDFLAGS += -L$(LIB_PREFIX)
-endif
-
 all: $(PHENIQS_SOURCES) configuration.h version.h $(PHENIQS_OBJECTS)
        $(CC) $(PHENIQS_OBJECTS) $(LDFLAGS) -pthread $(LIBS) -o $(PHENIQS_EXECUTABLE)
kstring.h:281:1: warning: multi-line comment [-Wcomment]
 // #define kroundup_size_t(x) (--(x),                                       \
 ^
cc -I/opt/conda/conda-bld/pheniqs_1524379253526/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_
placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_place/include -I/opt/conda/conda-bld/pheniqs_1524379253526/_h_env_placehold
_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac
ehold_placehold_placehold_place/include/rapidjson -std=c++11 -O3 -Wall -Wsign-compare -I/usr/local/include -c -o interface.o interface.cpp
In file included from json.h:42:0,
                 from url.h:34,
                 from interface.h:37,
                 from interface.cpp:2:
kstring.h:281:1: warning: multi-line comment [-Wcomment]
 // #define kroundup_size_t(x) (--(x),                                       \
 ^
In file included from interface.cpp:4:0:
configuration.h:2:1: error: stray ‘\’ in program
 const char configuration_json[] = {\n    0x7b, 0x0a, 0x22, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x3a, 0x20,
 ^
configuration.h:467:5: error: stray ‘\’ in program
     0x6c, 0x61, 0x76, 0x6f, 0x72, 0x21, 0x22, 0x0a, 0x7d, 0x0a,\n};
     ^
configuration.h:2:37: error: ‘n’ was not declared in this scope
 const char configuration_json[] = {\n    0x7b, 0x0a, 0x22, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x3a, 0x20,
                                     ^
configuration.h:2:42: error: expected ‘}’ before numeric constant
 const char configuration_json[] = {\n    0x7b, 0x0a, 0x22, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x3a, 0x20,
                                          ^
configuration.h:2:42: error: expected ‘,’ or ‘;’ before numeric constant
configuration.h:467:66: error: expected declaration before ‘}’ token
     0x6c, 0x61, 0x76, 0x6f, 0x72, 0x21, 0x22, 0x0a, 0x7d, 0x0a,\n};

from pheniqs.

jerowe avatar jerowe commented on May 28, 2024

I also created a patch to remove the '\n' characters from the configuration.h file.

--- configuration.sh    2018-04-22 10:45:53.000000000 +0400
+++ configuration.sh    2018-04-22 10:50:53.000000000 +0400
@@ -26,3 +26,5 @@

 echo "const char configuration_json[] = \
 {\n    $(cat configuration.json | sed -E 's/^ +//g' | hexdump -v -e '12/1 "0x%02x, " "\n" "    "' | sed -E 's/( 0x  ,)*$//' | grep -vE "^\s+$")\n};" >> configuration.h;
+tr '\n' ' ' < configuration.h > out.t
+mv out.t configuration.h

But then I got an error somewhere with the interface.o

from pheniqs.

jerowe avatar jerowe commented on May 28, 2024

Ok, I have hit a wall with this. How's about we make a plan of attack.

  1. Please build a minimal install example script, on linux, preferably with docker.
  2. The minimal install script should remove hardcoded variables things like PREFIX, CFLAGS, INCLUDE_PATH, CC etc from the Makefile.

If you get the minimal install script working on a docker image, and give me write access to the repo, I will get a CI service setup to at least test that it builds on both linux and mac. From there I can build it as a conda package.

from pheniqs.

jerowe avatar jerowe commented on May 28, 2024

Updates?

from pheniqs.

moonwatcher avatar moonwatcher commented on May 28, 2024

Sorry, just noticed this.

clang is not an MacOS thing, its an llvm compiler that often yields faster executables than gcc, but it should all build on gcc. https://clang.llvm.org

I see you have some issues with my xxd replacement. maybe I got something wrong, can you you please post what the configuration.h file looks like? I tried to make it look similar to what xxd emits.

I will run a set of tests tomorrow to see how everything builds on gcc and make adjustments, but clang was faster in my benchmarks on linux...

from pheniqs.

moonwatcher avatar moonwatcher commented on May 28, 2024

Also use g++ not gcc. I will do some testing for gcc on both MacOS and linux before the next commit but please provide some feedback about the xxd replacement script.

from pheniqs.

jerowe avatar jerowe commented on May 28, 2024

from pheniqs.

moonwatcher avatar moonwatcher commented on May 28, 2024

g++ is gcc. gcc is for C code while g++ automatically links to the C++ system libraries.

https://stackoverflow.com/questions/172587/what-is-the-difference-between-g-and-gcc

from pheniqs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.