source: branches/2929_PrioritizedGrammarEnumeration/HeuristicLab.Algorithms.DataAnalysis.PGE/3.3/make.sh @ 16620

Last change on this file since 16620 was 16620, checked in by hmaislin, 7 months ago

#2929: Reorganized folder structure for make script, removed explicit marshalling, erased go-side logging

File size: 1.5 KB
Line 
1#!/usr/bin/env bash
2set -e          # Exit if any return code not equals 0
3
4ScriptRoot=$(dirname "$(readlink -f "$0")")
5BuildHL=0
6
7case "$1" in
8"cprog")
9    CreateDLL=0
10    SimpleTest=0
11    ;;
12"dll")
13    CreateDLL=1
14    SimpleTest=0
15    ;;
16"hl")
17    BuildHL=1
18    ;&
19* | "all")
20    CreateDLL=1
21    SimpleTest=1
22    ;;
23esac
24
25export GOPATH="$ScriptRoot"
26
27export GOGC="off"
28export GODEBUG="cgocheck=0"
29export CGO_ENABLED=1
30
31export GOARCH=amd64
32export GOHOSTARCH=amd64
33export GOHOSTOS=windows
34export GOOS=windows
35
36cd "$ScriptRoot"
37
38cd ./src/go-pge
39
40CGO_ENABLED=1 \
41go build -o libpge.a -ldflags="-s -w " -gcflags=all="-N -l" -buildmode=c-archive \
42    pge.go
43
44echo "Created c-archive from go"
45
46gcc -x c testmulti.c -o testmulti.exe -std=c99 \
47    -L. -L../go-levmar/levmar-2.6 -L../go-levmar/levmar-2.6/libs64 \
48    -ggdb -fpic -m64 -pthread \
49    -lpge -lm -llevmar -llapack -lblas -lf2c -ltmglib -lWinMM -lntdll -lWS2_32 \
50    -Wno-implicit-function-declaration
51
52echo "Built C-Test programm"
53
54if [ $CreateDLL -eq 1 ]; then 
55    gcc -shared -pthread -o go-pge.dll pge.c libpge.a -lWinMM -lntdll -lWS2_32 \
56        -L../go-levmar/levmar-2.6 -L../go-levmar/levmar-2.6/libs64 \
57        -lm -llevmar -llapack -lblas -lf2c -ltmglib
58   
59    echo "Created PGE-DLL"
60    cp go-pge.dll ../../
61fi
62
63rm -f libpge.a
64rm -f libpge.h
65
66echo "Build succeeded"
67
68if [ $SimpleTest -eq 1 ]; then
69  echo "Starting simple test"
70  powershell -File ../../TestResults.ps1
71fi
72
73if [ $BuildHL -eq 1 ]; then
74    echo "Building HL"
75fi
76
Note: See TracBrowser for help on using the repository browser.