-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit a0d05d3
Showing
12 changed files
with
181 additions
and
0 deletions.
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,5 @@ | ||
#!/bin/bash | ||
|
||
for PROJ in c_simple cxx_string_expansion fortran_expansion; do | ||
(cd ${PROJ}; julia --color=yes build_tarballs.jl --verbose --debug) | ||
done |
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 @@ | ||
using BinaryBuilder | ||
|
||
name = "c_simple" | ||
version = v"1.2.3" | ||
|
||
# Collection of sources required to build libffi | ||
sources = [ | ||
"./bundled", | ||
] | ||
|
||
# Bash recipe for building across all platforms | ||
script = raw""" | ||
cd $WORKSPACE/srcdir/ | ||
make install | ||
""" | ||
|
||
# These are the platforms we will build for by default, unless further | ||
# platforms are passed in on the command line | ||
platforms = supported_platforms() | ||
|
||
# The products that we will ensure are always built | ||
products(prefix) = [ | ||
LibraryProduct(prefix, "libc_simple", :libc_simple) | ||
] | ||
|
||
# Dependencies that must be installed before this package can be built | ||
dependencies = [ | ||
] | ||
|
||
# Build the tarballs, and possibly a `build.jl` as well. | ||
build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies) | ||
|
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,15 @@ | ||
all: c_simple libc_simple.$(dlext) | ||
|
||
libc_simple.$(dlext): libc_simple.c | ||
$(CC) $(CPPFLAGS) $(CFLAGS) libc_simple.c -shared -o $@ $(LDFLAGS) | ||
|
||
c_simple: c_simple.c libc_simple.$(dlext) | ||
$(CC) $(CPPFLAGS) $(CFLAGS) c_simple.c -o $@ $(LDFLAGS) -L. -lc_simple | ||
|
||
install: all | ||
mkdir -p $(libdir) $(prefix)/bin | ||
cp -a libc_simple.$(dlext) $(libdir)/libc_simple.$(dlext) | ||
cp -a c_simple $(prefix)/bin/c_simple$(exeext) | ||
|
||
clean: | ||
rm -f libc_simple.$(dlext) c_simple |
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,17 @@ | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
|
||
int my_add(int x, int y); | ||
|
||
int main(int argc, char ** argv) { | ||
if (argc != 3) { | ||
printf("Usage: c_simple <x> <y>\n"); | ||
return 1; | ||
} | ||
|
||
int x = atoi(argv[1]); | ||
int y = atoi(argv[1]); | ||
int z = my_add(x, y); | ||
printf("%d + %d == %d\n", x, y, z); | ||
return 0; | ||
} |
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,3 @@ | ||
int my_add(int x, int y) { | ||
return x + y; | ||
} |
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 @@ | ||
using BinaryBuilder | ||
|
||
name = "cxx_string" | ||
version = v"1.2.3" | ||
|
||
# Collection of sources required to build libffi | ||
sources = [ | ||
"./bundled", | ||
] | ||
|
||
# Bash recipe for building across all platforms | ||
script = raw""" | ||
cd $WORKSPACE/srcdir/ | ||
make install | ||
""" | ||
|
||
# These are the platforms we will build for by default, unless further | ||
# platforms are passed in on the command line | ||
platforms = expand_cxx_versions(supported_platforms()) | ||
|
||
# The products that we will ensure are always built | ||
products(prefix) = [ | ||
LibraryProduct(prefix, "libcxx_string", :libcxx_string) | ||
] | ||
|
||
# Dependencies that must be installed before this package can be built | ||
dependencies = [ | ||
] | ||
|
||
# Build the tarballs, and possibly a `build.jl` as well. | ||
build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies) | ||
|
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,11 @@ | ||
all: libcxx_string.$(dlext) | ||
|
||
libcxx_string.$(dlext): libcxx_string.cc | ||
$(CXX) $(CPPFLAGS) $(CFLAGS) -fPIC $< -shared -o $@ $(LDFLAGS) | ||
|
||
install: all | ||
mkdir -p $(libdir) | ||
cp -a libcxx_string.$(dlext) $(libdir)/libcxx_string.$(dlext) | ||
|
||
clean: | ||
rm -f libcxx_string.$(dlext) |
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,9 @@ | ||
#include <string> | ||
|
||
std::string generate(void) { | ||
return std::string("Hello there!"); | ||
} | ||
|
||
int length(std::string foo) { | ||
return foo.length(); | ||
} |
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 @@ | ||
using BinaryBuilder | ||
|
||
name = "fortran_expansion" | ||
version = v"1.2.3" | ||
|
||
# Collection of sources required to build libffi | ||
sources = [ | ||
"./bundled", | ||
] | ||
|
||
# Bash recipe for building across all platforms | ||
script = raw""" | ||
cd $WORKSPACE/srcdir/ | ||
make install | ||
""" | ||
|
||
# These are the platforms we will build for by default, unless further | ||
# platforms are passed in on the command line | ||
platforms = expand_gfortran_versions(supported_platforms()) | ||
|
||
# The products that we will ensure are always built | ||
products(prefix) = [ | ||
ExecutableProduct(prefix, "hello_fortran", :hello_fortran) | ||
] | ||
|
||
# Dependencies that must be installed before this package can be built | ||
dependencies = [ | ||
] | ||
|
||
# Build the tarballs, and possibly a `build.jl` as well. | ||
build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies) | ||
|
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,16 @@ | ||
all: hello_fortran libhello_fortran.$(dlext) | ||
|
||
libhello_fortran.$(dlext): libhello.f | ||
$(FC) $(FPPFLAGS) $(FFLAGS) $< -shared -o $@ $(LDFLAGS) | ||
|
||
hello_fortran: hello.f | ||
$(FC) $(FPPFLAGS) $(FFLAGS) $< -o $@ $(LDFLAGS) | ||
|
||
install: all | ||
mkdir -p $(libdir) $(prefix)/bin | ||
cp -a libhello_fortran.$(dlext) $(libdir)/libhello_fortran.$(dlext) | ||
cp -a hello_fortran $(prefix)/bin/hello_fortran$(exeext) | ||
|
||
clean: | ||
rm -f libhello_fortran.$(dlext) hello_fortran | ||
|
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,3 @@ | ||
program hello | ||
print *, "Hello World!" | ||
end program hello |
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,6 @@ | ||
FUNCTION my_sum(x,y) | ||
REAL:: my_sum | ||
REAL:: x, y | ||
my_sum = x + y | ||
END | ||
|