diff --git a/README.md b/README.md index 78c78c1..ef1e347 100644 --- a/README.md +++ b/README.md @@ -13,13 +13,13 @@ to build all variations run ``` cd Seasocks -CONAN_USER= CONAN_CHANNEL= python build.py +CONAN_USERNAME= CONAN_CHANNEL= python build.py ``` to build a specific variant run the following commands: ``` -conan test_package Seasocks/1.3.2@/ -s build_type= -s compiler.libcxx= +conan create . Seasocks/1.3.2@/ -s build_type= -s compiler.libcxx= ``` ## SystemC @@ -28,13 +28,13 @@ download the SystemC distribution from http://www.accellera.org/downloads/standa ``` cd SystemC -CONAN_USER= CONAN_CHANNEL= python build.py +CONAN_USERNAME= CONAN_CHANNEL= python build.py ``` to build a specific variant run the following command ``` -conan test_package SystemC/2.3.2@minres/ -o SystemC:stdcxx= -s build_type= +conan create . SystemC/2.3.2@minres/ -o stdcxx= -s build_type= ``` where is one of 98, 11, or 14 @@ -45,13 +45,13 @@ download the SystemC distribution from http://www.accellera.org/downloads/standa ``` cd SystemCVerification -CONAN_USER= CONAN_CHANNEL= python build.py +CONAN_USERNAME= CONAN_CHANNEL= python build.py ``` to build a specific variant run the following command ``` -conan test_package SystemCVerification/2.0.0.a@minres/ -o SystemC:stdcxx= -s build_type= +conan create . SystemCVerification/2.0.1a@minres/ -o stdcxx= -s build_type= ``` where is one of 98, 11, or 14 diff --git a/Seasocks/conanfile.py b/Seasocks/conanfile.py index 7063b6d..0d3fb70 100644 --- a/Seasocks/conanfile.py +++ b/Seasocks/conanfile.py @@ -26,8 +26,9 @@ conan_basic_setup()''') def build(self): cmake = CMake(self, parallel=True) - self.run('cmake seasocks %s' % cmake.command_line) - self.run("cmake --build . --target install %s" % cmake.build_config) + cmake.configure(source_folder="seasocks") + cmake.build() + cmake.install() #def package(self): # nothing to do here now diff --git a/Seasocks/test_package/conanfile.py b/Seasocks/test_package/conanfile.py index 8463f53..b08cea5 100644 --- a/Seasocks/test_package/conanfile.py +++ b/Seasocks/test_package/conanfile.py @@ -3,13 +3,17 @@ import os class SeasocksTestConan(ConanFile): settings = "os", "compiler", "build_type", "arch" + options = {"shared": [True, False]} + default_options = "shared=True" generators = "cmake" build_requires = "Catch/1.9.2@uilianries/stable" + def configure(self): + self.options["Seasocks"].shared = self.options.shared + def build(self): cmake = CMake(self) - # Current dir is "test_package/build/" and CMakeLists.txt is in "test_package" - cmake.configure(source_dir=self.conanfile_directory, build_dir="./") + cmake.configure() cmake.build() def imports(self): diff --git a/SystemC/build.py b/SystemC/build.py index e977d0d..bee3e5e 100644 --- a/SystemC/build.py +++ b/SystemC/build.py @@ -2,13 +2,11 @@ from conan.packager import ConanMultiPackager if __name__ == "__main__": builder = ConanMultiPackager() - cxxstds = ['98','11','14'] archs = ['x86', 'x86_64'] types = ['Debug','Release'] - #configs = [[i,j,k] for i in cxxstds for j in archs for k in types] - #for triple in configs: - # builder.add(settings={"arch": triple[1], "build_type":triple[2]}, options={"SystemC:stdcxx" : triple[0]}, env_vars={}, build_requires={}) - configs = [[i,k] for i in cxxstds for k in types] + cxxstds = ['98', '11','14'] + shared = [True,False] + configs = [[i,k,s] for i in cxxstds for k in types for s in shared] for triple in configs: - builder.add(settings={"build_type":triple[1]}, options={"SystemC:stdcxx" : triple[0]}, env_vars={}, build_requires={}) + builder.add(settings={"build_type":triple[1]}, options={"stdcxx" : triple[0], "shared" : triple[2]}, env_vars={}, build_requires={}) builder.run() diff --git a/SystemC/conanfile.py b/SystemC/conanfile.py index dda3412..f007a4a 100644 --- a/SystemC/conanfile.py +++ b/SystemC/conanfile.py @@ -1,7 +1,7 @@ from conans import ConanFile, CMake -class SeasocksConan(ConanFile): +class SystemCConan(ConanFile): name = "SystemC" version = "2.3.2" license = "Apache 2.0 License" @@ -11,24 +11,28 @@ class SeasocksConan(ConanFile): options = {"shared": [True, False], "stdcxx":[98,11,14]} default_options = "shared=True","stdcxx=98" generators = "cmake" + source_subfolder = "systemc-2.3.2" exports_sources = "systemc-2.3.2/*" -# def build_id(self): -# self.info_build.settings.build_type = "Any" - -# def source(self): -# self.run("git clone https://github.com/Minres/SystemCLanguage.git") -# self.run("cd SystemCLanguage && git checkout master") - def build(self): cmake = CMake(self, parallel=True) - cmake.configure(source_dir="%s/systemc-2.3.2" % self.source_folder) - shared = "-DBUILD_SHARED_LIBS=ON" if self.options.shared else "-DBUILD_SHARED_LIBS=OFF" - self.run('cmake systemc-2.3.2 %s %s -DCMAKE_CXX_STANDARD=%s' % (cmake.command_line, shared, self.options.stdcxx)) - # self.run("cmake --build . %s" % cmake.build_config) - self.run("cmake --build . --target install %s" % cmake.build_config) + cmake.configure( + source_folder=self.source_subfolder, + args=[ + "-DBUILD_SHARED_LIBS=ON" if self.options.shared else "-DBUILD_SHARED_LIBS=OFF", + '-DCMAKE_CXX_STANDARD=%s' % self.options.stdcxx + ] + ) + cmake.build() + cmake.install() + + def package(self): + # Headers + #self.copy(pattern="*.h", dst="include", src="package/include", keep_path=True) + # Libs + #self.copy(pattern="*", dst="lib", src="package/lib", keep_path=False) def package_info(self): - self.cpp_info.libs = ["systemc"] + self.cpp_info.libs = ["systemc", "pthread"] diff --git a/SystemC/test_package/conanfile.py b/SystemC/test_package/conanfile.py index 1cee8c8..390d4bd 100644 --- a/SystemC/test_package/conanfile.py +++ b/SystemC/test_package/conanfile.py @@ -3,16 +3,19 @@ import os class SystemcTestConan(ConanFile): settings = "os", "compiler", "build_type", "arch" + options = {"stdcxx":[98,11,14], "shared":[True,False]} + default_options = "stdcxx=98","shared=True" generators = "cmake" + def configure(self): + self.options["SystemC"].stdcxx = self.options.stdcxx + self.options["SystemC"].shared = self.options.shared + def build(self): - cxxstd = self.options["SystemC"].stdcxx cmake = CMake(self) - # Current dir is "test_package/build/" and CMakeLists.txt is in "test_package" - cmake.configure(source_dir=self.conanfile_directory, build_dir="./") - #cmake.build() - self.run('cmake %s %s -DCMAKE_CXX_STANDARD=%s' % (self.conanfile_directory, cmake.command_line, cxxstd)) - self.run("cmake --build . %s" % cmake.build_config) + cmake.definitions["CMAKE_CXX_STANDARD"] = self.options["SystemC"].stdcxx + cmake.configure() + cmake.build() def imports(self): self.copy("*.dll", dst="bin", src="bin") diff --git a/SystemCVerification/build.py b/SystemCVerification/build.py index a19f0b5..94dd6a8 100644 --- a/SystemCVerification/build.py +++ b/SystemCVerification/build.py @@ -2,13 +2,10 @@ from conan.packager import ConanMultiPackager if __name__ == "__main__": builder = ConanMultiPackager() - cxxstds = ['98','11','14'] archs = ['x86', 'x86_64'] types = ['Debug','Release'] - #configs = [[i,j,k] for i in cxxstds for j in archs for k in types] - #for triple in configs: - # builder.add(settings={"arch": triple[1], "build_type":triple[2]}, options={"SystemCVerification:stdcxx" : triple[0]}, env_vars={}, build_requires={}) + cxxstds = ['98','11','14'] configs = [[i,k] for i in cxxstds for k in types] for triple in configs: - builder.add(settings={"build_type":triple[1]}, options={"SystemCVerification:stdcxx" : triple[0]}, env_vars={}, build_requires={}) + builder.add(settings={"build_type":triple[1]}, options={"stdcxx" : triple[0]}, env_vars={}, build_requires={}) builder.run() diff --git a/SystemCVerification/conanfile.py b/SystemCVerification/conanfile.py index 9d8d0c7..5856d7b 100644 --- a/SystemCVerification/conanfile.py +++ b/SystemCVerification/conanfile.py @@ -1,59 +1,57 @@ from conans import ConanFile, tools, AutoToolsBuildEnvironment - +import os class SystemcverificationConan(ConanFile): name = "SystemCVerification" - version = "2.0.0a" - folder = "scv-2.0.0a-20161019" + version = "2.0.1" license = "Apache 2.0 License" url = "https://github.com/Minres/conan-recipes/blob/master/SystemCVerification" description = "The SystemC Verification (SCV) library provides a common set of APIs that are used as a basis to verification activities with SystemC" settings = "os", "compiler", "build_type", "arch" options = {"stdcxx":[98,11,14]} default_options = "stdcxx=98" - generators = "txt" - exports_sources = "scv-2.0.0a-20161019/*" + generators = "gcc" + source_subfolder = "scv-2.0.1" + exports_sources = "scv-2.0.1/*" requires = "SystemC/2.3.2@minres/stable" def configure(self): self.options["SystemC"].stdcxx = self.options.stdcxx - # Maybe in windows we know that OpenSSL works better as shared (false) - #if self.settings.os == "Windows": - # self.options["OpenSSL"].shared = True - - # Or adjust any other available option - # self.options["Poco"].other_option = "foo" - def build(self): env_build = AutoToolsBuildEnvironment(self) if self.options.stdcxx == "14": - env_build.cxx_flags = "-std=c++14" + env_build.cxx_flags = "-std=gnu++14" elif self.options.stdcxx == "11": - env_build.cxx_flags = "-std=c++11" + env_build.cxx_flags = "-std=gnu++11" elif self.options.stdcxx == "98": - env_build.cxx_flags = "-std=c++98" - #env_build.libs.append("pthread") - #env_build.defines.append("NEW_DEFINE=23") - - self.output.info(env_build.vars) - with tools.environment_append(env_build.vars): - self.run("cd %s && mkdir _build" % self.folder) - configure_command = 'cd %s/_build && env && ../configure --prefix=%s/_install --with-systemc=%s --disable-debug --disable-opt' - self.output.info(configure_command % (self.folder, self.build_folder, self.deps_cpp_info["SystemC"].rootpath)) - self.run(configure_command % (self.folder, self.build_folder, self.deps_cpp_info["SystemC"].rootpath)) - self.run("cd %s/_build && make -j && make install" % self.folder) + env_build.cxx_flags = "-std=gnu++98" + env_build.fpic = True + tools.mkdir("build") + with tools.chdir("build"): + env_build.configure( + configure_dir=os.path.join(self.source_folder, self.source_subfolder), + args=[ + '--prefix=%s' % os.path.join(self.source_folder, 'install'), + '--with-systemc=%s' % self.deps_cpp_info["SystemC"].rootpath, + '--disable-debug', + '--disable-opt' + ] + ) + env_build.make() + env_build.make(args=["install"]) + #env_build.make(args=["check"]) def package(self): # Headers - self.copy(pattern="*.h", dst="include", src="_install/include", keep_path=True) + self.copy(pattern="*.h", dst="include", src="install/include", keep_path=True) # Libs - self.copy(pattern="*", dst="lib", src="_install/lib-linux", keep_path=False) - self.copy(pattern="*", dst="lib", src="_install/lib-linux64", keep_path=False) - self.copy(pattern="*", dst="lib", src="_install/lib-macosx", keep_path=False) - self.copy(pattern="*", dst="lib", src="_install/lib-macosx64", keep_path=False) - self.copy(pattern="*", dst="lib", src="_install/lib-cygwin", keep_path=False) - self.copy(pattern="*", dst="lib", src="_install/lib-mingw", keep_path=False) + self.copy(pattern="*", dst="lib", src="install/lib-linux", keep_path=False) + self.copy(pattern="*", dst="lib", src="install/lib-linux64", keep_path=False) + self.copy(pattern="*", dst="lib", src="install/lib-macosx", keep_path=False) + self.copy(pattern="*", dst="lib", src="install/lib-macosx64", keep_path=False) + self.copy(pattern="*", dst="lib", src="install/lib-cygwin", keep_path=False) + self.copy(pattern="*", dst="lib", src="install/lib-mingw", keep_path=False) def package_info(self): self.cpp_info.libs = ["scv"] diff --git a/SystemCVerification/scv4systemc-2.3.2.patch b/SystemCVerification/scv-2.0.0a_systemc-2.3.2.patch similarity index 100% rename from SystemCVerification/scv4systemc-2.3.2.patch rename to SystemCVerification/scv-2.0.0a_systemc-2.3.2.patch diff --git a/SystemCVerification/scv-2.0.1_systemc-2.3.2.patch b/SystemCVerification/scv-2.0.1_systemc-2.3.2.patch new file mode 100644 index 0000000..22439d3 --- /dev/null +++ b/SystemCVerification/scv-2.0.1_systemc-2.3.2.patch @@ -0,0 +1,95 @@ +diff -rupN scv-2.0.0a-20161019/configure scv-2.0.0a-20161019-patched/configure +--- scv-2.0.0a-20161019/configure 2016-10-19 23:25:31.000000000 +0200 ++++ scv-2.0.0a-20161019-patched/configure 2017-10-28 17:00:36.367027496 +0200 +@@ -16136,7 +16136,7 @@ sparc) + case "$GXX" in + yes) echo 'setting compiler flags for g++' + AM_CXXFLAGS="$SPARC_GNU_CXXFLAGS" +- CXXFLAGS="$GNU_OPT $GNU_DBG" ++ CXXFLAGS="$CXXFLAGS $GNU_OPT $GNU_DBG" + CXXFLAGS_DEBUG="$DEF_GNU_DBG" + CXXFLAGS_OPT="$DEF_GNU_OPT" + AM_CFLAGS="$SPARC_GNU_CFLAGS" +@@ -16152,8 +16152,8 @@ sparc) + echo 'setting library options for g++ on Solaris' + ;; + '') echo 'setting compiler flags for NOT g++' +- AM_CXXFLAGS="$SPARC_CC_CXXFLAGS" +- CXXFLAGS="$SUN_CC_OPT $SUN_CC_DBG" ++ AM_CXXFLAGS="$SPARC_CC_CXXFLAGS" ++ CXXFLAGS="$CXXFLAGS $SUN_CC_OPT $SUN_CC_DBG" + CXXFLAGS_DEBUG="$DEF_SUN_CC_DBG" + CXXFLAGS_OPT="$DEF_SUN_CC_OPT" + AM_CFLAGS="$SPARC_CC_CFLAGS" +@@ -16173,7 +16173,7 @@ hppa*) + case "$GXX" in + yes) echo 'setting compiler flags for g++' + AM_CXXFLAGS="$HPPA_GNU_CXXFLAGS" +- CXXFLAGS="$GNU_OPT $GNU_DBG" ++ CXXFLAGS="$CXXFLAGS $GNU_OPT $GNU_DBG" + CXXFLAGS_DEBUG="$DEF_GNU_DBG" + CXXFLAGS_OPT="$DEF_GNU_OPT" + AM_CFLAGS="$HPPA_GNU_CFLAGS" +@@ -16192,7 +16192,7 @@ hppa*) + ;; + '') echo 'setting compiler flags and defines for HP aCC' + AM_CXXFLAGS="$HPPA_ACC_CXXFLAGS" +- CXXFLAGS="$HP_ACC_OPT $HP_ACC_DBG" ++ CXXFLAGS="$CXXFLAGS $HP_ACC_OPT $HP_ACC_DBG" + CXXFLAGS_DEBUG="$DEF_HP_ACC_DBG" + CXXFLAGS_OPT="$DEF_HP_ACC_OPT" + AM_CFLAGS="$HPPA_ACC_XFLAGS" +@@ -16216,7 +16216,7 @@ powerpc*) + case "$GXX" in + yes) echo 'setting compiler flags for g++' + AM_CXXFLAGS="$LINUX_GNU_CXXFLAGS" +- CXXFLAGS="$GNU_OPT $GNU_DBG" ++ CXXFLAGS="$CXXFLAGS $GNU_OPT $GNU_DBG" + CXXFLAGS_DEBUG="$DEF_GNU_DBG" + CXXFLAGS_OPT="$DEF_GNU_OPT" + AM_CFLAGS="$LINUX_GNU_CFLAGS" +@@ -16235,7 +16235,7 @@ powerpc*) + ;; + '') echo 'setting compiler flags for NOT g++' + AM_CXXFLAGS="$LINUX_GNU_CXXFLAGS" +- CXXFLAGS="$GNU_OPT $GNU_DBG" ++ CXXFLAGS="$CXXFLAGS $GNU_OPT $GNU_DBG" + CXXFLAGS_DEBUG="$DEF_GNU_DBG" + CXXFLAGS_OPT="$DEF_GNU_OPT" + AM_CFLAGS="$LINUX_GNU_CFLAGS" +@@ -16256,7 +16256,7 @@ i[3456]86*) + case "$GXX" in + yes) echo 'setting compiler flags for g++' + AM_CXXFLAGS="$LINUX_GNU_CXXFLAGS" +- CXXFLAGS="$GNU_OPT $GNU_DBG" ++ CXXFLAGS="$CXXFLAGS $GNU_OPT $GNU_DBG" + CXXFLAGS_DEBUG="$DEF_GNU_DBG" + CXXFLAGS_OPT="$DEF_GNU_OPT" + AM_CFLAGS="$LINUX_GNU_CFLAGS" +@@ -16275,7 +16275,7 @@ i[3456]86*) + ;; + '') echo 'setting compiler flags for NOT g++' + AM_CXXFLAGS="$LINUX_GNU_CXXFLAGS" +- CXXFLAGS="$GNU_OPT $GNU_DBG" ++ CXXFLAGS="$CXXFLAGS $GNU_OPT $GNU_DBG" + CXXFLAGS_DEBUG="$DEF_GNU_DBG" + CXXFLAGS_OPT="$DEF_GNU_OPT" + AM_CFLAGS="$LINUX_GNU_CFLAGS" +@@ -16296,7 +16296,7 @@ x86_64*) + case "$GXX" in + yes) echo 'setting compiler flags for g++' + AM_CXXFLAGS="$LINUX_GNU_CXXFLAGS" +- CXXFLAGS="$GNU_OPT $GNU_DBG" ++ CXXFLAGS="$CXXFLAGS $GNU_OPT $GNU_DBG" + CXXFLAGS_DEBUG="$DEF_GNU_DBG" + CXXFLAGS_OPT="$DEF_GNU_OPT" + AM_CFLAGS="$LINUX_GNU_CFLAGS" +@@ -16315,7 +16315,7 @@ x86_64*) + ;; + '') echo 'setting compiler flags for NOT g++' + AM_CXXFLAGS="$LINUX_GNU_CXXFLAGS" +- CXXFLAGS="$GNU_OPT $GNU_DBG" ++ CXXFLAGS="$CXXFLAGS $GNU_OPT $GNU_DBG" + CXXFLAGS_DEBUG="$DEF_GNU_DBG" + CXXFLAGS_OPT="$DEF_GNU_OPT" + AM_CFLAGS="$LINUX_GNU_CFLAGS" diff --git a/SystemCVerification/test_package/conanfile.py b/SystemCVerification/test_package/conanfile.py index 7008c80..08f166a 100644 --- a/SystemCVerification/test_package/conanfile.py +++ b/SystemCVerification/test_package/conanfile.py @@ -1,18 +1,28 @@ from conans import ConanFile, CMake import os +import pprint class SystemcverificationTestConan(ConanFile): settings = "os", "compiler", "build_type", "arch" + options = {"stdcxx":[98,11,14]} + default_options = "stdcxx=98" generators = "cmake" + requires = "SystemC/2.3.2@minres/stable" + + def configure(self): + self.options["SystemCVerification"].stdcxx = self.options.stdcxx + if self.settings.compiler == 'gcc' and self.settings.compiler.version > 5: + self.output.info("Forcing use of libstdc++11") + self.settings.compiler.libcxx='libstdc++11' def build(self): - cxxstd = self.options["SystemC"].stdcxx cmake = CMake(self) # Current dir is "test_package/build/" and CMakeLists.txt is in "test_package" - cmake.configure(source_dir=self.conanfile_directory, build_dir="./") - #cmake.build() - self.run('cmake %s %s -DCMAKE_CXX_STANDARD=%s' % (self.conanfile_directory, cmake.command_line, cxxstd)) - self.run("cmake --build . %s" % cmake.build_config) + cmake.configure( + args=[ + '-DCMAKE_CXX_STANDARD=%s' % self.options.stdcxx + ]) + cmake.build() def imports(self): self.copy("*.dll", dst="bin", src="bin")