update
This commit is contained in:
@ -1,3 +1,3 @@
|
||||
# amscpptemplate25a
|
||||
# amscppperm1
|
||||
|
||||
Rearrange my C++ project template in an attempt to harmonize everything and modernize my build scripts.
|
||||
Library containing structures to iterate over permutations and provide permutation sign.
|
16
amscppperm1.code-workspace
Normal file
16
amscppperm1.code-workspace
Normal file
@ -0,0 +1,16 @@
|
||||
{
|
||||
"folders": [
|
||||
{
|
||||
"path": "."
|
||||
},
|
||||
{
|
||||
"path": "../../sourceprojs23/camsimglib3"
|
||||
},
|
||||
{
|
||||
"path": "../../sourceprojs23/amsmathutil2"
|
||||
},
|
||||
{
|
||||
"path": "../../sourceprojs23/amscppfilesys3"
|
||||
}
|
||||
]
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
tar -czvf ../amscpptemplate25a.tar.gz ./*
|
||||
tar -czvf ../amscppperm1.tar.gz ./*
|
||||
|
||||
scp ../amscpptemplate25a.tar.gz aschinder@amssolarempire.com:~/workspace/projects
|
||||
scp ../amscppperm1.tar.gz aschinder@amssolarempire.com:~/workspace/projects
|
||||
|
Binary file not shown.
@ -7,25 +7,24 @@ from shutil import copytree
|
||||
|
||||
from amsbuildlib4 import *
|
||||
|
||||
libname = "amscpptemplate25a.linux64" #static library name to generate
|
||||
libname = "amscppperm1.linux64" #static library name to generate
|
||||
binname = "tests" #create this executable when compiling main.c or main.cpp
|
||||
commondir = "../../linux64" #common directory to pul libraries and includes from
|
||||
depdir = "./dependencies/linux64" #local pre-compiled dependency libraries and their includes
|
||||
installdir = "../../linux64" #directory to install to when finished
|
||||
builddir = "./build_linux64"
|
||||
|
||||
doinstall = False #copies the build_output to the install dir when finished
|
||||
doinstall = True #copies the build_output to the install dir when finished
|
||||
cc = "g++" #compiler
|
||||
cflags = "-fPIC"
|
||||
libraries = "-l{}".format(libname)
|
||||
libdirs = "-L{} -L{}/lib -L{}/lib".format(builddir,commondir,depdir)
|
||||
libdirs = "-L{} -L{}/lib".format(builddir,commondir)
|
||||
linkerflags = "-static -static-libgcc -Wl,-rpath=."
|
||||
srcexts = [".c",".cpp"]
|
||||
binsrc = ["main.c","main.cpp"] #ignore these files when compiling the static library
|
||||
|
||||
#keyword list to control the compilers/linkers
|
||||
kwargs = dict()
|
||||
include = "-I./include -I{}/include -I{}/include".format(commondir, depdir)
|
||||
include = "-I./include -I{}/include".format(commondir)
|
||||
kwargs["include"] = include
|
||||
kwargs["flags"] = cflags
|
||||
kwargs["libdir"] = libdirs
|
||||
@ -51,7 +50,7 @@ if(doinstall):
|
||||
#Copy a binary to the common bin folder
|
||||
|
||||
#Push any libraries to the common lib folder
|
||||
shutil.copy('{}/lib/lib{}.a'.format(builddir,libname),commondir)
|
||||
shutil.copy('{}/lib{}.a'.format(builddir,libname),"{}/lib".format(commondir))
|
||||
|
||||
#Copy include files to the common include folder
|
||||
copytree('./include/',commondir+'/include/',dirs_exist_ok=True)
|
||||
|
@ -7,25 +7,24 @@ from shutil import copytree
|
||||
|
||||
from amsbuildlib4 import *
|
||||
|
||||
libname = "amscpptemplate25a.linux64" #static library name to generate
|
||||
libname = "amscppperm1.linux64" #static library name to generate
|
||||
binname = "tests" #create this executable when compiling main.c or main.cpp
|
||||
commondir = "../../linux64" #common directory to pul libraries and includes from
|
||||
depdir = "./dependencies/linux64" #local pre-compiled dependency libraries and their includes
|
||||
installdir = "../../linux64" #directory to install to when finished
|
||||
builddir = "./build_linux64"
|
||||
|
||||
doinstall = False #copies the build_output to the install dir when finished
|
||||
doinstall = True #copies the build_output to the install dir when finished
|
||||
cc = "g++" #compiler
|
||||
cflags = "-fPIC"
|
||||
libraries = "-l{}".format(libname)
|
||||
libdirs = "-L{} -L{}/lib -L{}/lib".format(builddir,commondir,depdir)
|
||||
libdirs = "-L{} -L{}/lib".format(builddir,commondir)
|
||||
linkerflags = "-static -static-libgcc -Wl,-rpath=."
|
||||
srcexts = [".c",".cpp"]
|
||||
binsrc = ["main.c","main.cpp"] #ignore these files when compiling the static library
|
||||
|
||||
#keyword list to control the compilers/linkers
|
||||
kwargs = dict()
|
||||
include = "-I./include -I{}/include -I{}/include".format(commondir, depdir)
|
||||
include = "-I./include -I{}/include".format(commondir)
|
||||
kwargs["include"] = include
|
||||
kwargs["flags"] = cflags
|
||||
kwargs["libdir"] = libdirs
|
||||
|
@ -7,7 +7,7 @@ from shutil import copytree
|
||||
|
||||
from amsbuildlib4 import *
|
||||
|
||||
libname = "amscpptemplate25a.mingw64" #static library name to generate
|
||||
libname = "amscppperm1.mingw64" #static library name to generate
|
||||
binname = "tests" #create this executable when compiling main.c or main.cpp
|
||||
commondir = "../../winx64" #common directory to pul libraries and includes from
|
||||
depdir = "./dependencies/winx64" #local pre-compiled dependency libraries and their includes
|
||||
|
@ -7,7 +7,7 @@ from shutil import copytree
|
||||
|
||||
from amsbuildlib4 import *
|
||||
|
||||
libname = "amscpptemplate25a.mingw64" #static library name to generate
|
||||
libname = "amscppperm1.mingw64" #static library name to generate
|
||||
binname = "tests" #create this executable when compiling main.c or main.cpp
|
||||
commondir = "../../winx64" #common directory to pul libraries and includes from
|
||||
depdir = "./dependencies/winx64" #local pre-compiled dependency libraries and their includes
|
||||
|
@ -7,7 +7,7 @@ from shutil import copytree
|
||||
|
||||
from amsbuildlib4 import *
|
||||
|
||||
libname = "amscpptemplate25a.msvc64" #static library name to generate
|
||||
libname = "amscppperm1.msvc64" #static library name to generate
|
||||
binname = "tests" #create this executable when compiling main.c or main.cpp
|
||||
commondir = "../../winx64" #common directory to pul libraries and includes from
|
||||
depdir = "./dependencies/winx64" #local pre-compiled dependency libraries and their includes
|
||||
|
@ -7,7 +7,7 @@ from shutil import copytree
|
||||
|
||||
from amsbuildlib4 import *
|
||||
|
||||
libname = "amscpptemplate25a.msvc64" #static library name to generate
|
||||
libname = "amscppperm1.msvc64" #static library name to generate
|
||||
binname = "tests.exe" #create this executable when compiling main.c or main.cpp
|
||||
commondir = "../../winx64" #common directory to pul libraries and includes from
|
||||
depdir = "./dependencies/winx64" #local pre-compiled dependency libraries and their includes
|
||||
|
BIN
build_linux64/libamscppperm1.linux64.a
Normal file
BIN
build_linux64/libamscppperm1.linux64.a
Normal file
Binary file not shown.
Binary file not shown.
BIN
build_linux64/objstore/amscppperm1.o
Normal file
BIN
build_linux64/objstore/amscppperm1.o
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
build_linux64/objstore/permutation.o
Normal file
BIN
build_linux64/objstore/permutation.o
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
31
include/amscppperm1/amscppperm1.hpp
Normal file
31
include/amscppperm1/amscppperm1.hpp
Normal file
@ -0,0 +1,31 @@
|
||||
#ifndef __AMSCPPPERM1_HPP__
|
||||
#define __AMSCPPPERM1_HPP__
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
namespace ams
|
||||
{
|
||||
namespace perm
|
||||
{
|
||||
|
||||
//Buffer operations
|
||||
|
||||
|
||||
//Permutation class
|
||||
class permutation
|
||||
{
|
||||
public:
|
||||
int dim;
|
||||
int *data;
|
||||
|
||||
permutation();
|
||||
~permutation();
|
||||
};
|
||||
|
||||
}; //end namespace perm
|
||||
}; //end namespace ams
|
||||
|
||||
#endif
|
@ -1,15 +0,0 @@
|
||||
#ifndef __AMSCPPTEMPLATE25A_HPP__
|
||||
#define __AMSCPPTEMPLATE25A_HPP__
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
namespace ams
|
||||
{
|
||||
void amscpptemplate_testfn();
|
||||
void amscpptemplate_testfn2();
|
||||
};
|
||||
|
||||
#endif
|
@ -6,7 +6,7 @@ from build.amsbuildlib4 import *
|
||||
|
||||
if(len(sys.argv)>=2):
|
||||
if(sys.argv[1]=="clean"):
|
||||
obj_list = flist('./build_msvc64',recurse=True,exts=['.o'])
|
||||
obj_list = flist('./build_msvc64',recurse=True,exts=['.o','.obj'])
|
||||
for o in obj_list:
|
||||
os.remove('{}'.format(o))
|
||||
exit()
|
||||
|
4
pull.sh
4
pull.sh
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
scp aschinder@amssolarempire.com:workspace/projects/amscpptemplate25a.tar.gz ../
|
||||
tar xzvf ../amscpptemplate25a.tar.gz ./
|
||||
scp aschinder@amssolarempire.com:workspace/projects/amscppperm1.tar.gz ../
|
||||
tar xzvf ../amscppperm1.tar.gz ./
|
||||
|
9
src/amscppperm1/amscppperm1.cpp
Normal file
9
src/amscppperm1/amscppperm1.cpp
Normal file
@ -0,0 +1,9 @@
|
||||
#include <amscppperm1/amscppperm1.hpp>
|
||||
|
||||
namespace ams
|
||||
{
|
||||
namespace perm
|
||||
{
|
||||
|
||||
}; //end namespace perm
|
||||
}; //end namespace ams
|
25
src/amscppperm1/permutation.cpp
Normal file
25
src/amscppperm1/permutation.cpp
Normal file
@ -0,0 +1,25 @@
|
||||
#include <amscppperm1/amscppperm1.hpp>
|
||||
|
||||
namespace ams
|
||||
{
|
||||
namespace perm
|
||||
{
|
||||
|
||||
permutation::permutation()
|
||||
{
|
||||
dim = 0;
|
||||
data = NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
permutation::~permutation()
|
||||
{
|
||||
if(data!=NULL) {delete[] data; data = NULL;}
|
||||
dim = 0;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
}; //end namespace perm
|
||||
}; //end namespace ams
|
@ -1,12 +0,0 @@
|
||||
#include <amscpptemplate25a/amscpptemplate25a.hpp>
|
||||
|
||||
namespace ams
|
||||
{
|
||||
|
||||
void amscpptemplate_testfn2()
|
||||
{
|
||||
printf("Test function 2.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
};
|
@ -1,12 +0,0 @@
|
||||
#include <amscpptemplate25a/amscpptemplate25a.hpp>
|
||||
|
||||
namespace ams
|
||||
{
|
||||
|
||||
void amscpptemplate_testfn()
|
||||
{
|
||||
printf("Test function.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
};
|
@ -1,9 +1,9 @@
|
||||
#include <amscpptemplate25a/amscpptemplate25a.hpp>
|
||||
#include <amscppperm1/amscppperm1.hpp>
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
int ret = 0;
|
||||
printf("ams c++ project template tests.\n");
|
||||
ams::amscpptemplate_testfn();
|
||||
|
||||
return ret;
|
||||
}
|
Reference in New Issue
Block a user