main
Aaron 1 month ago
parent 3c1f8626fd
commit 41a3fbcdea

@ -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.

@ -0,0 +1,16 @@
{
"folders": [
{
"path": "."
},
{
"path": "../../sourceprojs23/camsimglib3"
},
{
"path": "../../sourceprojs23/amsmathutil2"
},
{
"path": "../../sourceprojs23/amscppfilesys3"
}
]
}

@ -1,5 +1,5 @@
#!/usr/bin/bash #!/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

@ -7,25 +7,24 @@ from shutil import copytree
from amsbuildlib4 import * 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 binname = "tests" #create this executable when compiling main.c or main.cpp
commondir = "../../linux64" #common directory to pul libraries and includes from 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 installdir = "../../linux64" #directory to install to when finished
builddir = "./build_linux64" 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 cc = "g++" #compiler
cflags = "-fPIC" cflags = "-fPIC"
libraries = "-l{}".format(libname) 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=." linkerflags = "-static -static-libgcc -Wl,-rpath=."
srcexts = [".c",".cpp"] srcexts = [".c",".cpp"]
binsrc = ["main.c","main.cpp"] #ignore these files when compiling the static library binsrc = ["main.c","main.cpp"] #ignore these files when compiling the static library
#keyword list to control the compilers/linkers #keyword list to control the compilers/linkers
kwargs = dict() kwargs = dict()
include = "-I./include -I{}/include -I{}/include".format(commondir, depdir) include = "-I./include -I{}/include".format(commondir)
kwargs["include"] = include kwargs["include"] = include
kwargs["flags"] = cflags kwargs["flags"] = cflags
kwargs["libdir"] = libdirs kwargs["libdir"] = libdirs
@ -51,7 +50,7 @@ if(doinstall):
#Copy a binary to the common bin folder #Copy a binary to the common bin folder
#Push any libraries to the common lib 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 #Copy include files to the common include folder
copytree('./include/',commondir+'/include/',dirs_exist_ok=True) copytree('./include/',commondir+'/include/',dirs_exist_ok=True)

@ -7,25 +7,24 @@ from shutil import copytree
from amsbuildlib4 import * 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 binname = "tests" #create this executable when compiling main.c or main.cpp
commondir = "../../linux64" #common directory to pul libraries and includes from 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 installdir = "../../linux64" #directory to install to when finished
builddir = "./build_linux64" 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 cc = "g++" #compiler
cflags = "-fPIC" cflags = "-fPIC"
libraries = "-l{}".format(libname) 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=." linkerflags = "-static -static-libgcc -Wl,-rpath=."
srcexts = [".c",".cpp"] srcexts = [".c",".cpp"]
binsrc = ["main.c","main.cpp"] #ignore these files when compiling the static library binsrc = ["main.c","main.cpp"] #ignore these files when compiling the static library
#keyword list to control the compilers/linkers #keyword list to control the compilers/linkers
kwargs = dict() kwargs = dict()
include = "-I./include -I{}/include -I{}/include".format(commondir, depdir) include = "-I./include -I{}/include".format(commondir)
kwargs["include"] = include kwargs["include"] = include
kwargs["flags"] = cflags kwargs["flags"] = cflags
kwargs["libdir"] = libdirs kwargs["libdir"] = libdirs

@ -7,7 +7,7 @@ from shutil import copytree
from amsbuildlib4 import * 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 binname = "tests" #create this executable when compiling main.c or main.cpp
commondir = "../../winx64" #common directory to pul libraries and includes from commondir = "../../winx64" #common directory to pul libraries and includes from
depdir = "./dependencies/winx64" #local pre-compiled dependency libraries and their includes depdir = "./dependencies/winx64" #local pre-compiled dependency libraries and their includes

@ -7,7 +7,7 @@ from shutil import copytree
from amsbuildlib4 import * 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 binname = "tests" #create this executable when compiling main.c or main.cpp
commondir = "../../winx64" #common directory to pul libraries and includes from commondir = "../../winx64" #common directory to pul libraries and includes from
depdir = "./dependencies/winx64" #local pre-compiled dependency libraries and their includes depdir = "./dependencies/winx64" #local pre-compiled dependency libraries and their includes

@ -7,7 +7,7 @@ from shutil import copytree
from amsbuildlib4 import * 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 binname = "tests" #create this executable when compiling main.c or main.cpp
commondir = "../../winx64" #common directory to pul libraries and includes from commondir = "../../winx64" #common directory to pul libraries and includes from
depdir = "./dependencies/winx64" #local pre-compiled dependency libraries and their includes depdir = "./dependencies/winx64" #local pre-compiled dependency libraries and their includes

@ -7,7 +7,7 @@ from shutil import copytree
from amsbuildlib4 import * 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 binname = "tests.exe" #create this executable when compiling main.c or main.cpp
commondir = "../../winx64" #common directory to pul libraries and includes from commondir = "../../winx64" #common directory to pul libraries and includes from
depdir = "./dependencies/winx64" #local pre-compiled dependency libraries and their includes depdir = "./dependencies/winx64" #local pre-compiled dependency libraries and their includes

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -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(len(sys.argv)>=2):
if(sys.argv[1]=="clean"): 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: for o in obj_list:
os.remove('{}'.format(o)) os.remove('{}'.format(o))
exit() exit()

@ -1,4 +1,4 @@
#!/usr/bin/bash #!/usr/bin/bash
scp aschinder@amssolarempire.com:workspace/projects/amscpptemplate25a.tar.gz ../ scp aschinder@amssolarempire.com:workspace/projects/amscppperm1.tar.gz ../
tar xzvf ../amscpptemplate25a.tar.gz ./ tar xzvf ../amscppperm1.tar.gz ./

@ -0,0 +1,9 @@
#include <amscppperm1/amscppperm1.hpp>
namespace ams
{
namespace perm
{
}; //end namespace perm
}; //end namespace ams

@ -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 main(int argc, char* argv[])
{ {
int ret = 0; int ret = 0;
printf("ams c++ project template tests.\n"); printf("ams c++ project template tests.\n");
ams::amscpptemplate_testfn();
return ret; return ret;
} }
Loading…
Cancel
Save