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 -fPIC to julia-config.jl #14443

Merged
merged 1 commit into from
Jan 8, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions contrib/julia-config.jl
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ end
function cflags()
arg1 = replace(initDir(),"\\","\\\\\\\\");
arg2 = replace(includeDir(),"\\","\\\\");
@unix_only return """-fPIC -DJULIA_INIT_DIR=\\"$arg1\\" -I$arg2""";
return """-DJULIA_INIT_DIR=\\"$arg1\\" -I$arg2""";
end

Expand Down
2 changes: 1 addition & 1 deletion doc/manual/embedding.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ We start with a simple C program that initializes Julia and calls some Julia cod

In order to build this program you have to put the path to the Julia header into the include path and link against ``libjulia``. For instance, when Julia is installed to ``$JULIA_DIR``, one can compile the above test program ``test.c`` with ``gcc`` using::

gcc -o test -I$JULIA_DIR/include/julia -L$JULIA_DIR/usr/lib -ljulia test.c
gcc -o test -fPIC -I$JULIA_DIR/include/julia -L$JULIA_DIR/usr/lib test.c -ljulia

Alternatively, look at the ``embedding.c`` program in the Julia source tree in the ``examples/`` folder. The file ``ui/repl.c`` program is another simple example of how to set ``jl_options`` options while linking against ``libjulia``.

Expand Down