Giter VIP home page Giter VIP logo

Comments (10)

dnknth avatar dnknth commented on July 20, 2024 3

Here my Makefile that gets TerminusDB up and running. Sorry, I did not bother with the Linux and Windows rules, so it is just a quick hack for x86_64-darwin. Hope you can use some of it (rename to Makefile for testing)

Makefile.txt

Requirements via Homebrew (not included in the Makefile):

  • swi-prolog
  • rust

from terminus_store_prolog.

rrooij avatar rrooij commented on July 20, 2024 1

You may be interested in the new build instructions I released on how to run TerminusDB itself on Mac OS.

https://github.com/terminusdb/terminusdb-server/blob/dev/docs/BUILD.md#mac-os

You may have figured this out yourself already. 😄

from terminus_store_prolog.

pmoura avatar pmoura commented on July 20, 2024

Patching the make and Makefile files to use the .dylib extension solves the error above but then we get linker errors:

   Compiling terminus-store v0.7.6
   Compiling terminus-store-prolog v0.1.0 (/Users/pmoura/.local/share/swi-prolog/pack/terminus_store_prolog/rust)
    Finished release [optimized] target(s) in 56.04s
cp rust/target/release//libterminus_store_prolog.dylib lib/x86_64-darwin
gcc -shared -fPIC -pthread -I"/Users/pmoura/lib/swipl/include" -Wall -o lib/x86_64-darwin/libterminus_store.dylib ./c/*.c -Isrc -L./lib/x86_64-darwin -Wl,-rpath /Users/pmoura/.local/share/swi-prolog/pack/terminus_store_prolog/lib/x86_64-darwin -lterminus_store_prolog
Undefined symbols for architecture x86_64:
  "_PL_blob_data", referenced from:
      _release_store_blob in blobs-f1a0e7.o
      _release_named_graph_blob in blobs-f1a0e7.o
      _release_layer_blob in blobs-f1a0e7.o
      _release_layer_builder_blob in blobs-f1a0e7.o
      _release_subject_lookup_blob in blobs-f1a0e7.o
      _release_subject_predicate_lookup_blob in blobs-f1a0e7.o
      _release_predicate_lookup_blob in blobs-f1a0e7.o
      ...
  "_PL_close_foreign_frame", referenced from:
      _pl_object_lookup_subject_predicate in terminus_store-5f51f0.o
...

from terminus_store_prolog.

matko avatar matko commented on July 20, 2024

I see in your other issue that you managed to get a working build in the end. Was that on osx?

Are you able to install other packs that have a native compilation step? For example, are you able to install the hdt pack?

from terminus_store_prolog.

pmoura avatar pmoura commented on July 20, 2024

I'm currently trying to get a working setup on Ubuntu 18.04.3. No progress on macOS. Still debugging installation of the hdt pack (on Ubuntu):

?- pack_install('https://github.com/GavinMendelGleason/hdt.git').
% Cloning into '/home/pmoura/.local/share/swi-prolog/pack/hdt'...
Verify package status (anonymously)
	at "https://www.swi-prolog.org/pack/query" Y/n? 
% Contacting server at https://www.swi-prolog.org/pack/query ...
ERROR: Server reported the following error:
ERROR: No permission to register pack(hdt) `'https://github.com/GavinMendelGleason/hdt.git''
Package:                hdt
Title:                  Access RDF HDT files
Installed version:      0.5
Author:                 Jan Wielemaker <[email protected]>
Maintainer:             Jan Wielemaker <[email protected]>
Packager:               Jan Wielemaker <[email protected]>
Home page:              https://github.com/GavinMendelGleason/hdt
Download URL:           https://github.com/GavinMendelGleason/hdt.git
Run post installation scripts for pack "hdt" Y/n? 
% git submodule update --init
% Submodule 'hdt-cpp' (https://github.com/rdfhdt/hdt-cpp.git) registered for path 'hdt-cpp'
% Cloning into '/home/pmoura/.local/share/swi-prolog/pack/hdt/hdt-cpp'...
% Submodule path 'hdt-cpp': checked out 'a8aafe32e0209a50a7671ddd5376b5c0d6934496'
% cd hdt-cpp && ./autogen.sh
ERROR: configure.ac:10: error: possibly undefined macro: AC_SUBST
%       If this token and others are legitimate, please use m4_pattern_allow.
%       See the Autoconf documentation.
ERROR: configure.ac:48: error: possibly undefined macro: AC_DEFINE
% autoreconf: /usr/bin/autoconf failed with exit status: 1
% Makefile:22: recipe for target 'hdt-cpp/libhdt/.make-senitel' failed
% make: *** [hdt-cpp/libhdt/.make-senitel] Error 1
ERROR: Process "process(path(make),[all])": exit status: 2
ERROR: In:
ERROR:   [20] throw(error(process_error(...,...),_1954))
ERROR:   [18] '$apply':forall(prolog_pack:member(all,...),prolog_pack:run_process(...,...,...)) at /usr/lib/swi-prolog/boot/apply.pl:52
ERROR:   [14] prolog_pack:pack_post_install(hdt,'/home/pmoura/.local/share/swi-prolog/pack/hdt',[git(true),...|...]) at /usr/lib/swi-prolog/library/prolog_pack.pl:1017
ERROR:    [9] <user>
ERROR: 
ERROR: Note: some frames are missing due to last-call optimization.
ERROR: Re-run your program in debug mode (:- debug.) to get more detail.

from terminus_store_prolog.

pmoura avatar pmoura commented on July 20, 2024

The errors above when installing the hdt pack were due to a missing dependency. Btw, in the BUILD.md file in the master branch, it would be preferable to instruct to install hdt-cpp before installing the hdt pack to avoid these errors.

from terminus_store_prolog.

matko avatar matko commented on July 20, 2024

Makefile contained a definition for SOEXT, setting it to 'so' unconditionally. The latest commit removes that.

Are you able to install the pack now?

from terminus_store_prolog.

pmoura avatar pmoura commented on July 20, 2024

I noticed that. In the clean target, there's also a hard-coded .so extension that should be changed to .$(SOEXT). But, as I mentioned above, that doesn't solve the problem as the SWI-Prolog prolog_pack:save_build_environment('./') predicate, that is used to generate the buildenv.sh source'd during compilation is setting the extension to .so. From the installation of SWI-Prolog itself on macOS, both .so files and .dylib files are generated and used without trouble. Thus, fixing this issue may requite just to find the correct linker incantation that avoids the Undefined symbols for architecture x86_64 errors above. I will take another look to it tomorrow.

from terminus_store_prolog.

dnknth avatar dnknth commented on July 20, 2024

Oh, I forget to mention that this has been only tested by running ./make manually in the pack directory.
I am not familiar with the environment variables that SWI passes to the make run in pack_install/1, so it will likely need some tuning.

Just a rough first cut.

from terminus_store_prolog.

rrooij avatar rrooij commented on July 20, 2024

Seems like this should work now with the latest change from @dnknth

from terminus_store_prolog.

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.