From a0e46bdf59d3b7717b17ed554ffc7ad799afdcb9 Mon Sep 17 00:00:00 2001 From: jaycedowell Date: Mon, 30 Sep 2019 09:07:18 -0600 Subject: [PATCH 01/48] Initial commit of the disk backed ring idea. This concept uses a mmapped file to create a ring buffer that is larger than the system memory at the expense of access speed. Hopefully the speed is not too much of an issue for some pipelines. --- python/bifrost/Space.py | 9 +- python/bifrost/libbifrost.py | 6 +- src/bifrost/memory.h | 5 +- src/memory.cpp | 254 ++++++++++++++++++++++++++++++++++- src/ring_impl.cpp | 6 +- 5 files changed, 264 insertions(+), 16 deletions(-) diff --git a/python/bifrost/Space.py b/python/bifrost/Space.py index 4ed590161..c3cbf0c7e 100644 --- a/python/bifrost/Space.py +++ b/python/bifrost/Space.py @@ -31,19 +31,22 @@ _bf.BF_SPACE_SYSTEM: 'system', _bf.BF_SPACE_CUDA: 'cuda', _bf.BF_SPACE_CUDA_HOST: 'cuda_host', - _bf.BF_SPACE_CUDA_MANAGED: 'cuda_managed'} + _bf.BF_SPACE_CUDA_MANAGED: 'cuda_managed', + _bf.BF_SPACE_DISK_BACKED: 'disk_backed'} SPACEMAP_FROM_STR = {'auto': _bf.BF_SPACE_AUTO, 'system': _bf.BF_SPACE_SYSTEM, 'cuda': _bf.BF_SPACE_CUDA, 'cuda_host': _bf.BF_SPACE_CUDA_HOST, - 'cuda_managed': _bf.BF_SPACE_CUDA_MANAGED} + 'cuda_managed': _bf.BF_SPACE_CUDA_MANAGED, + 'disk_backed': _bf.BF_SPACE_DISK_BACKED} class Space(object): def __init__(self, s): if isinstance(s, basestring): if s not in set(['auto', 'system', - 'cuda', 'cuda_host', 'cuda_managed']): + 'cuda', 'cuda_host', 'cuda_managed', + 'disk_backed']): raise ValueError('Invalid space: %s' % s) self._space = s elif isinstance(s, _bf.BFspace) or isinstance(s, int): diff --git a/python/bifrost/libbifrost.py b/python/bifrost/libbifrost.py index 369e0ed90..606277a6c 100644 --- a/python/bifrost/libbifrost.py +++ b/python/bifrost/libbifrost.py @@ -147,7 +147,8 @@ def _get(func, *args): 'system': _bf.BF_SPACE_SYSTEM, 'cuda': _bf.BF_SPACE_CUDA, 'cuda_host': _bf.BF_SPACE_CUDA_HOST, - 'cuda_managed': _bf.BF_SPACE_CUDA_MANAGED} + 'cuda_managed': _bf.BF_SPACE_CUDA_MANAGED, + 'disk_backed': _bf.BF_SPACE_DISK_BACKED} def _string2space(s): if s not in STRING2SPACE: raise KeyError("Invalid space '" + str(s) + @@ -158,6 +159,7 @@ def _string2space(s): _bf.BF_SPACE_SYSTEM: 'system', _bf.BF_SPACE_CUDA: 'cuda', _bf.BF_SPACE_CUDA_HOST: 'cuda_host', - _bf.BF_SPACE_CUDA_MANAGED: 'cuda_managed'} + _bf.BF_SPACE_CUDA_MANAGED: 'cuda_managed', + _bf.BF_SPACE_DISK_BACKED: 'disk_backed'} def _space2string(i): return SPACE2STRING[i] diff --git a/src/bifrost/memory.h b/src/bifrost/memory.h index 653a701f0..b14befb90 100644 --- a/src/bifrost/memory.h +++ b/src/bifrost/memory.h @@ -43,13 +43,14 @@ extern "C" { #ifndef BF_ALIGNMENT #define BF_ALIGNMENT 4096//512 #endif - + typedef enum BFspace_ { BF_SPACE_AUTO = 0, BF_SPACE_SYSTEM = 1, // aligned_alloc BF_SPACE_CUDA = 2, // cudaMalloc BF_SPACE_CUDA_HOST = 3, // cudaHostAlloc - BF_SPACE_CUDA_MANAGED = 4 // cudaMallocManaged + BF_SPACE_CUDA_MANAGED = 4, // cudaMallocManaged + BF_SPACE_DISK_BACKED = 5 // disk-backed memory } BFspace; BFstatus bfMalloc(void** ptr, BFsize size, BFspace space); diff --git a/src/memory.cpp b/src/memory.cpp index 096819ae8..f98caa155 100644 --- a/src/memory.cpp +++ b/src/memory.cpp @@ -35,12 +35,224 @@ #include // For posix_memalign #include // For memcpy #include +#include +#include // For flock +#include // For fstat +#include // For getpid +#include // For opendir, readdir, closedir +#include +#include +#include +#include #define BF_IS_POW2(x) (x) && !((x) & ((x) - 1)) static_assert(BF_IS_POW2(BF_ALIGNMENT), "BF_ALIGNMENT must be a power of 2"); #undef BF_IS_POW2 //static_assert(BF_ALIGNMENT >= 8, "BF_ALIGNMENT must be >= 8"); +#ifndef BF_DISK_BACKED_DIR + #define BF_DISK_BACKED_DIR "/tmp/bifrost" +#endif + +void mmake_dir(std::string path, int perms=775) { + if( std::system(("mkdir -p "+path+" -m "+std::to_string(perms)).c_str()) ) { + throw std::runtime_error("Failed to create path: "+path); + } +} +void mremove_all(std::string path) { + if( std::system(("rm -rf "+path).c_str()) ) { + throw std::runtime_error("Failed to remove all: "+path); + } +} +void mremove_dir(std::string path) { + if( std::system(("rmdir "+path+" 2> /dev/null").c_str()) ) { + throw std::runtime_error("Failed to remove dir: "+path); + } +} +void mremove_file(std::string path) { + if( std::system(("rm -f "+path).c_str()) ) { + throw std::runtime_error("Failed to remove file: "+path); + } +} +bool mprocess_exists(pid_t pid) { + struct stat s; + return !(stat(("/proc/"+std::to_string(pid)).c_str(), &s) == -1 + && errno == ENOENT); +} + +std::string mget_dirname(std::string filename) { + // TODO: This is crude, but works for our proclog use-case + return filename.substr(0, filename.find_last_of("/")); +} + +class MLockFile { + std::string _lockfile; + int _fd; +public: + MLockFile(MLockFile const& ) = delete; + MLockFile& operator=(MLockFile const& ) = delete; + MLockFile(std::string lockfile) : _lockfile(lockfile) { + while( true ) { + _fd = open(_lockfile.c_str(), O_CREAT, 600); + flock(_fd, LOCK_EX); + struct stat fd_stat, lockfile_stat; + fstat(_fd, &fd_stat); + stat(_lockfile.c_str(), &lockfile_stat); + // Compare inodes + if( fd_stat.st_ino == lockfile_stat.st_ino ) { + // Got the lock + break; + } + close(_fd); + } + } + ~MLockFile() { + unlink(_lockfile.c_str()); + flock(_fd, LOCK_UN); + } +}; + +class MMapMgr { + static constexpr const char* base_mmapdir = BF_DISK_BACKED_DIR; + std::string _mmapdir; + std::map _filenames; + std::map _fds; + std::map _lengths; + + void try_base_mmapdir_cleanup() { + // Do this with a file lock to avoid interference from other processes + MLockFile lock(std::string(base_mmapdir) + ".lock"); + DIR* dp; + // Remove pid dirs for which a corresponding process does not exist + if( (dp = opendir(base_mmapdir)) ) { + struct dirent* ep; + while( (ep = readdir(dp)) ) { + pid_t pid = atoi(ep->d_name); + if( pid && !mprocess_exists(pid) ) { + mremove_all(std::string(base_mmapdir) + "/" + + std::to_string(pid)); + } + } + closedir(dp); + } + // Remove the base_logdir if it's empty + try { mremove_dir(base_mmapdir); } + catch( std::exception ) {} + } + void cleanup(std::string filename, int fd) { + if( fd >= 0 ) { + ::close(fd); + } + try { mremove_file(filename); } + catch( std::exception ) {} + } + MMapMgr() + : _mmapdir(std::string(base_mmapdir) + "/" + std::to_string(getpid())) { + this->try_base_mmapdir_cleanup(); + mmake_dir(base_mmapdir, 777); + mmake_dir(_mmapdir); + } + ~MMapMgr() { + void** data; + for(auto& x : _filenames) { + data = x.first; + this->free(*data); + } + try { + mremove_all(_mmapdir); + this->try_base_mmapdir_cleanup(); + } catch( std::exception ) {} + } +public: + MMapMgr(MMapMgr& ) = delete; + MMapMgr& operator=(MMapMgr& ) = delete; + static MMapMgr& get() { + static MMapMgr mmm; + return mmm; + } + inline bool is_mmap(void** data) { + if( _filenames.count(data) == 0 ) { + return false; + } else { + return true; + } + } + int alloc(void** data, BFsize size) { + // Create + char tempname[256]; + strcpy(tempname, _mmapdir.c_str()); + strcat(tempname, "/mmapXXXXXX"); + int fd = ::mkstemp(tempname); + std::string filename = std::string(tempname); + std::cout << "filename: " << filename << std::endl; + if( fd < 0 ) { + this->cleanup(filename, fd); + return 1; + } + + // Allocate + int status = ::posix_fallocate(fd, 0, size); + if( status != 0 ) { + this->cleanup(filename, fd); + return 2; + } + + // MMap + *data = ::mmap(nullptr, size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0); + if( *data == MAP_FAILED ) { + this->cleanup(filename, fd); + return 3; + } + + // Advise the kernel of how we'll use it + ::madvise(*data, size, MADV_SEQUENTIAL); + + // Save and return + _filenames[data] = filename; + _fds[data] = fd; + _lengths[data] = size; + return 0; + } + int sync(void* data) { + if( !this->is_mmap((void**)&data) ) { + return -1; + } + + BFsize length = _lengths[(void**)&data]; + return ::msync(data, length, MS_ASYNC|MS_INVALIDATE); + } + void* memcpy(void* dest, void* src, BFsize count) { + ::memcpy(dest, src, count); + if( this->is_mmap((void**)&dest) ) { + this->sync(dest); + } + return dest; + } + void* memset(void* dest, int ch, BFsize count) { + ::memset(dest, ch, count); + if( this->is_mmap((void**)&dest) ) { + this->sync(dest); + } + return dest; + } + int free(void* data) { + if( !this->is_mmap((void**)&data) ) { + return -1; + } + + std::string filename = _filenames[(void**)&data]; + _filenames.erase((void**)&data); + int fd = _fds[(void**)&data]; + _fds.erase((void**)&data); + BFsize length = _lengths[(void**)&data]; + _lengths.erase((void**)&data); + + ::munmap(data, length); + this->cleanup(filename, fd); + return 0; + } +}; + BFstatus bfGetSpace(const void* ptr, BFspace* space) { BF_ASSERT(ptr, BF_STATUS_INVALID_POINTER); #if !defined BF_CUDA_ENABLED || !BF_CUDA_ENABLED @@ -56,7 +268,11 @@ BFstatus bfGetSpace(const void* ptr, BFspace* space) { // up in cuda-memcheck? // Note: cudaPointerGetAttributes only works for memory allocated with // CUDA API functions, so if it fails we just assume sysmem. - *space = BF_SPACE_SYSTEM; + if( MMapMgr::get().is_mmap((void**)&ptr) ) { + *space = BF_SPACE_DISK_BACKED; + } else { + *space = BF_SPACE_SYSTEM; + } // WAR to avoid the ignored failure showing up later cudaGetLastError(); } else if( ptr_attrs.isManaged ) { @@ -87,6 +303,7 @@ const char* bfGetSpaceString(BFspace space) { case BF_SPACE_CUDA: return "cuda"; case BF_SPACE_CUDA_HOST: return "cuda_host"; case BF_SPACE_CUDA_MANAGED: return "cuda_managed"; + case BF_SPACE_DISK_BACKED: return "disk_backed"; default: return "unknown"; } } @@ -103,6 +320,11 @@ BFstatus bfMalloc(void** ptr, BFsize size, BFspace space) { //printf("bfMalloc --> %p\n", data); break; } + case BF_SPACE_DISK_BACKED: { + int err = MMapMgr::get().alloc((void**)&data, size); + BF_ASSERT(!err, BF_STATUS_MEM_ALLOC_FAILED); + break; + } #if defined BF_CUDA_ENABLED && BF_CUDA_ENABLED case BF_SPACE_CUDA: { BF_CHECK_CUDA(cudaMalloc((void**)&data, size), @@ -135,6 +357,7 @@ BFstatus bfFree(void* ptr, BFspace space) { } switch( space ) { case BF_SPACE_SYSTEM: ::free(ptr); break; + case BF_SPACE_DISK_BACKED: MMapMgr::get().free(ptr); break; #if defined BF_CUDA_ENABLED && BF_CUDA_ENABLED case BF_SPACE_CUDA: cudaFree(ptr); break; case BF_SPACE_CUDA_HOST: cudaFreeHost(ptr); break; @@ -152,26 +375,32 @@ BFstatus bfMemcpy(void* dst, if( count ) { BF_ASSERT(dst, BF_STATUS_INVALID_POINTER); BF_ASSERT(src, BF_STATUS_INVALID_POINTER); -#if !defined BF_CUDA_ENABLED || !BF_CUDA_ENABLED - ::memcpy(dst, src, count); -#else // Note: Explicitly dispatching to ::memcpy was found to be much faster // than using cudaMemcpyDefault. if( src_space == BF_SPACE_AUTO ) bfGetSpace(src, &src_space); if( dst_space == BF_SPACE_AUTO ) bfGetSpace(dst, &dst_space); cudaMemcpyKind kind = cudaMemcpyDefault; switch( src_space ) { +#if defined BF_CUDA_ENABLED && BF_CUDA_ENABLED case BF_SPACE_CUDA_HOST: // fall-through +#endif + case BF_SPACE_DISK_BACKED: // fall-through case BF_SPACE_SYSTEM: { switch( dst_space ) { +#if defined BF_CUDA_ENABLED && BF_CUDA_ENABLED case BF_SPACE_CUDA_HOST: // fall-through +#endif + case BF_SPACE_DISK_BACKED: // fall-through case BF_SPACE_SYSTEM: ::memcpy(dst, src, count); return BF_STATUS_SUCCESS; +#if defined BF_CUDA_ENABLED && BF_CUDA_ENABLED case BF_SPACE_CUDA: kind = cudaMemcpyHostToDevice; break; // TODO: BF_SPACE_CUDA_MANAGED +#endif default: BF_FAIL("Valid bfMemcpy dst space", BF_STATUS_INVALID_ARGUMENT); } break; } +#if defined BF_CUDA_ENABLED && BF_CUDA_ENABLED case BF_SPACE_CUDA: { switch( dst_space ) { case BF_SPACE_CUDA_HOST: // fall-through @@ -181,9 +410,11 @@ BFstatus bfMemcpy(void* dst, default: BF_FAIL("Valid bfMemcpy dst space", BF_STATUS_INVALID_ARGUMENT); } break; +#endif } default: BF_FAIL("Valid bfMemcpy src space", BF_STATUS_INVALID_ARGUMENT); } +#if defined BF_CUDA_ENABLED && BF_CUDA_ENABLED BF_TRACE_STREAM(g_cuda_stream); BF_CHECK_CUDA(cudaMemcpyAsync(dst, src, count, kind, g_cuda_stream), BF_STATUS_MEM_OP_FAILED); @@ -217,27 +448,32 @@ BFstatus bfMemcpy2D(void* dst, if( width*height ) { BF_ASSERT(dst, BF_STATUS_INVALID_POINTER); BF_ASSERT(src, BF_STATUS_INVALID_POINTER); -#if !defined BF_CUDA_ENABLED || !BF_CUDA_ENABLED - memcpy2D(dst, dst_stride, src, src_stride, width, height); -#else // Note: Explicitly dispatching to ::memcpy was found to be much faster // than using cudaMemcpyDefault. if( src_space == BF_SPACE_AUTO ) bfGetSpace(src, &src_space); if( dst_space == BF_SPACE_AUTO ) bfGetSpace(dst, &dst_space); cudaMemcpyKind kind = cudaMemcpyDefault; switch( src_space ) { +#if defined BF_CUDA_ENABLED && BF_CUDA_ENABLED case BF_SPACE_CUDA_HOST: // fall-through +#endif + case BF_SPACE_DISK_BACKED: // fall-through case BF_SPACE_SYSTEM: { switch( dst_space ) { +#if defined BF_CUDA_ENABLED && BF_CUDA_ENABLED case BF_SPACE_CUDA_HOST: // fall-through +#endif case BF_SPACE_SYSTEM: memcpy2D(dst, dst_stride, src, src_stride, width, height); return BF_STATUS_SUCCESS; +#if defined BF_CUDA_ENABLED && BF_CUDA_ENABLED case BF_SPACE_CUDA: kind = cudaMemcpyHostToDevice; break; // TODO: Is this the right thing to do? case BF_SPACE_CUDA_MANAGED: kind = cudaMemcpyDefault; break; +#endif default: BF_FAIL("Valid bfMemcpy2D dst space", BF_STATUS_INVALID_ARGUMENT); } break; } +#if defined BF_CUDA_ENABLED && BF_CUDA_ENABLED case BF_SPACE_CUDA: { switch( dst_space ) { case BF_SPACE_CUDA_HOST: // fall-through @@ -249,8 +485,10 @@ BFstatus bfMemcpy2D(void* dst, } break; } +#endif default: BF_FAIL("Valid bfMemcpy2D src space", BF_STATUS_INVALID_ARGUMENT); } +#if defined BF_CUDA_ENABLED && BF_CUDA_ENABLED BF_TRACE_STREAM(g_cuda_stream); BF_CHECK_CUDA(cudaMemcpy2DAsync(dst, dst_stride, src, src_stride, @@ -272,6 +510,7 @@ BFstatus bfMemset(void* ptr, bfGetSpace(ptr, &space); } switch( space ) { + case BF_SPACE_DISK_BACKED: // fall-through case BF_SPACE_SYSTEM: ::memset(ptr, value, count); break; #if defined BF_CUDA_ENABLED && BF_CUDA_ENABLED case BF_SPACE_CUDA_HOST: ::memset(ptr, value, count); break; @@ -309,6 +548,7 @@ BFstatus bfMemset2D(void* ptr, bfGetSpace(ptr, &space); } switch( space ) { + case BF_SPACE_DISK_BACKED: // fall-through case BF_SPACE_SYSTEM: memset2D(ptr, stride, value, width, height); break; #if defined BF_CUDA_ENABLED && BF_CUDA_ENABLED case BF_SPACE_CUDA_HOST: memset2D(ptr, stride, value, width, height); break; diff --git a/src/ring_impl.cpp b/src/ring_impl.cpp index 57da516df..1e31a2f15 100644 --- a/src/ring_impl.cpp +++ b/src/ring_impl.cpp @@ -98,10 +98,12 @@ BFring_impl::BFring_impl(const char* name, BFspace space) BF_ASSERT_EXCEPTION(space==BF_SPACE_SYSTEM || space==BF_SPACE_CUDA || space==BF_SPACE_CUDA_HOST || - space==BF_SPACE_CUDA_MANAGED, + space==BF_SPACE_CUDA_MANAGED || + space==BF_SPACE_DISK_BACKED, BF_STATUS_INVALID_ARGUMENT); #else - BF_ASSERT_EXCEPTION(space==BF_SPACE_SYSTEM, + BF_ASSERT_EXCEPTION(space==BF_SPACE_SYSTEM || + space==BF_SPACE_DISK_BACKED, BF_STATUS_INVALID_ARGUMENT); #endif From f04ca10fcf36dc2bd940d1e73c21d5dfbf774a06 Mon Sep 17 00:00:00 2001 From: jaycedowell Date: Mon, 30 Sep 2019 09:21:22 -0600 Subject: [PATCH 02/48] Fixed build problems with the CPU-only version. --- src/memory.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/memory.cpp b/src/memory.cpp index f98caa155..675bb0e21 100644 --- a/src/memory.cpp +++ b/src/memory.cpp @@ -379,7 +379,9 @@ BFstatus bfMemcpy(void* dst, // than using cudaMemcpyDefault. if( src_space == BF_SPACE_AUTO ) bfGetSpace(src, &src_space); if( dst_space == BF_SPACE_AUTO ) bfGetSpace(dst, &dst_space); +#if defined BF_CUDA_ENABLED && BF_CUDA_ENABLED cudaMemcpyKind kind = cudaMemcpyDefault; +#endif switch( src_space ) { #if defined BF_CUDA_ENABLED && BF_CUDA_ENABLED case BF_SPACE_CUDA_HOST: // fall-through @@ -410,8 +412,8 @@ BFstatus bfMemcpy(void* dst, default: BF_FAIL("Valid bfMemcpy dst space", BF_STATUS_INVALID_ARGUMENT); } break; -#endif } +#endif default: BF_FAIL("Valid bfMemcpy src space", BF_STATUS_INVALID_ARGUMENT); } #if defined BF_CUDA_ENABLED && BF_CUDA_ENABLED @@ -452,7 +454,9 @@ BFstatus bfMemcpy2D(void* dst, // than using cudaMemcpyDefault. if( src_space == BF_SPACE_AUTO ) bfGetSpace(src, &src_space); if( dst_space == BF_SPACE_AUTO ) bfGetSpace(dst, &dst_space); +#if defined BF_CUDA_ENABLED && BF_CUDA_ENABLED cudaMemcpyKind kind = cudaMemcpyDefault; +#endif switch( src_space ) { #if defined BF_CUDA_ENABLED && BF_CUDA_ENABLED case BF_SPACE_CUDA_HOST: // fall-through From 2d5a5824b40efb1249b10a661cb6eef72179ad13 Mon Sep 17 00:00:00 2001 From: jaycedowell Date: Mon, 30 Sep 2019 10:59:38 -0600 Subject: [PATCH 03/48] Renamed to BF_SPACE_MAPPED since that seems a little more clear. Cleaned up the space accesssibility checkers in both C++ and Python. --- python/bifrost/libbifrost.py | 8 ++-- python/bifrost/memory.py | 13 +++++- src/memory.cpp | 80 +++++++++++++++++++----------------- src/ring_impl.cpp | 8 ++-- src/utils.hpp | 8 +++- 5 files changed, 69 insertions(+), 48 deletions(-) diff --git a/python/bifrost/libbifrost.py b/python/bifrost/libbifrost.py index 606277a6c..fe63cf801 100644 --- a/python/bifrost/libbifrost.py +++ b/python/bifrost/libbifrost.py @@ -145,10 +145,10 @@ def _get(func, *args): STRING2SPACE = {'auto': _bf.BF_SPACE_AUTO, 'system': _bf.BF_SPACE_SYSTEM, + 'mapped': _bf.BF_SPACE_MAPPED, 'cuda': _bf.BF_SPACE_CUDA, 'cuda_host': _bf.BF_SPACE_CUDA_HOST, - 'cuda_managed': _bf.BF_SPACE_CUDA_MANAGED, - 'disk_backed': _bf.BF_SPACE_DISK_BACKED} + 'cuda_managed': _bf.BF_SPACE_CUDA_MANAGED} def _string2space(s): if s not in STRING2SPACE: raise KeyError("Invalid space '" + str(s) + @@ -157,9 +157,9 @@ def _string2space(s): SPACE2STRING = {_bf.BF_SPACE_AUTO: 'auto', _bf.BF_SPACE_SYSTEM: 'system', + _bf.BF_SPACE_MAPPED: 'mapped', _bf.BF_SPACE_CUDA: 'cuda', _bf.BF_SPACE_CUDA_HOST: 'cuda_host', - _bf.BF_SPACE_CUDA_MANAGED: 'cuda_managed', - _bf.BF_SPACE_DISK_BACKED: 'disk_backed'} + _bf.BF_SPACE_CUDA_MANAGED: 'cuda_managed'} def _space2string(i): return SPACE2STRING[i] diff --git a/python/bifrost/memory.py b/python/bifrost/memory.py index c6765a340..d56019656 100644 --- a/python/bifrost/memory.py +++ b/python/bifrost/memory.py @@ -35,10 +35,19 @@ def space_accessible(space, from_spaces): from_spaces = set(from_spaces) if space in from_spaces: return True + elif space in ('system', 'mapped'): + return 'system' in from_spaces \ + or 'mapped' in from_spaces \ + or 'cuda_host' in from_spaces \ + or 'cuda_managed' in from_spaces elif space == 'cuda_host': - return 'system' in from_spaces + return 'system' in from_spaces \ + or 'mapped' in from_spaces + or 'cuda_managed' in from_spaces elif space == 'cuda_managed': - return 'system' in from_spaces or 'cuda' in from_spaces + return 'system' in from_spaces \ + or 'mapped' in from_spaces \ + or 'cuda' in from_spaces else: return False diff --git a/src/memory.cpp b/src/memory.cpp index 675bb0e21..a42bcd489 100644 --- a/src/memory.cpp +++ b/src/memory.cpp @@ -50,8 +50,8 @@ static_assert(BF_IS_POW2(BF_ALIGNMENT), "BF_ALIGNMENT must be a power of 2"); #undef BF_IS_POW2 //static_assert(BF_ALIGNMENT >= 8, "BF_ALIGNMENT must be >= 8"); -#ifndef BF_DISK_BACKED_DIR - #define BF_DISK_BACKED_DIR "/tmp/bifrost" +#ifndef BF_MAPPED_DIR + #define BF_MAPPED_DIR "/tmp/bifrost" #endif void mmake_dir(std::string path, int perms=775) { @@ -112,31 +112,31 @@ class MLockFile { } }; -class MMapMgr { - static constexpr const char* base_mmapdir = BF_DISK_BACKED_DIR; - std::string _mmapdir; +class MappedMgr { + static constexpr const char* base_mapdir = BF_MAPPED_DIR; + std::string _mapdir; std::map _filenames; std::map _fds; std::map _lengths; - void try_base_mmapdir_cleanup() { + void try_base_mapdir_cleanup() { // Do this with a file lock to avoid interference from other processes - MLockFile lock(std::string(base_mmapdir) + ".lock"); + MLockFile lock(std::string(base_mapdir) + ".lock"); DIR* dp; // Remove pid dirs for which a corresponding process does not exist - if( (dp = opendir(base_mmapdir)) ) { + if( (dp = opendir(base_mapdir)) ) { struct dirent* ep; while( (ep = readdir(dp)) ) { pid_t pid = atoi(ep->d_name); if( pid && !mprocess_exists(pid) ) { - mremove_all(std::string(base_mmapdir) + "/" + + mremove_all(std::string(base_mapdir) + "/" + std::to_string(pid)); } } closedir(dp); } // Remove the base_logdir if it's empty - try { mremove_dir(base_mmapdir); } + try { mremove_dir(base_mapdir); } catch( std::exception ) {} } void cleanup(std::string filename, int fd) { @@ -146,29 +146,29 @@ class MMapMgr { try { mremove_file(filename); } catch( std::exception ) {} } - MMapMgr() - : _mmapdir(std::string(base_mmapdir) + "/" + std::to_string(getpid())) { - this->try_base_mmapdir_cleanup(); - mmake_dir(base_mmapdir, 777); - mmake_dir(_mmapdir); + MappedMgr() + : _mapdir(std::string(base_mapdir) + "/" + std::to_string(getpid())) { + this->try_base_mapdir_cleanup(); + mmake_dir(base_mapdir, 777); + mmake_dir(_mapdir); } - ~MMapMgr() { + ~MappedMgr() { void** data; for(auto& x : _filenames) { data = x.first; this->free(*data); } try { - mremove_all(_mmapdir); - this->try_base_mmapdir_cleanup(); + mremove_all(_mapdir); + this->try_base_mapdir_cleanup(); } catch( std::exception ) {} } public: - MMapMgr(MMapMgr& ) = delete; - MMapMgr& operator=(MMapMgr& ) = delete; - static MMapMgr& get() { - static MMapMgr mmm; - return mmm; + MappedMgr(MappedMgr& ) = delete; + MappedMgr& operator=(MappedMgr& ) = delete; + static MappedMgr& get() { + static MappedMgr mm; + return mm; } inline bool is_mmap(void** data) { if( _filenames.count(data) == 0 ) { @@ -180,7 +180,7 @@ class MMapMgr { int alloc(void** data, BFsize size) { // Create char tempname[256]; - strcpy(tempname, _mmapdir.c_str()); + strcpy(tempname, _mapdir.c_str()); strcat(tempname, "/mmapXXXXXX"); int fd = ::mkstemp(tempname); std::string filename = std::string(tempname); @@ -256,7 +256,11 @@ class MMapMgr { BFstatus bfGetSpace(const void* ptr, BFspace* space) { BF_ASSERT(ptr, BF_STATUS_INVALID_POINTER); #if !defined BF_CUDA_ENABLED || !BF_CUDA_ENABLED - *space = BF_SPACE_SYSTEM; + if( MappedMgr::get().is_mmap((void**)&ptr) ) { + *space = BF_SPACE_MAPPED; + } else { + *space = BF_SPACE_SYSTEM; + } #else cudaPointerAttributes ptr_attrs; cudaError_t ret = cudaPointerGetAttributes(&ptr_attrs, ptr); @@ -268,8 +272,8 @@ BFstatus bfGetSpace(const void* ptr, BFspace* space) { // up in cuda-memcheck? // Note: cudaPointerGetAttributes only works for memory allocated with // CUDA API functions, so if it fails we just assume sysmem. - if( MMapMgr::get().is_mmap((void**)&ptr) ) { - *space = BF_SPACE_DISK_BACKED; + if( MappedMgr::get().is_mmap((void**)&ptr) ) { + *space = BF_SPACE_MAPPED; } else { *space = BF_SPACE_SYSTEM; } @@ -300,10 +304,10 @@ const char* bfGetSpaceString(BFspace space) { switch( space ) { case BF_SPACE_AUTO: return "auto"; case BF_SPACE_SYSTEM: return "system"; + case BF_SPACE_MAPPED: return "mapped"; case BF_SPACE_CUDA: return "cuda"; case BF_SPACE_CUDA_HOST: return "cuda_host"; case BF_SPACE_CUDA_MANAGED: return "cuda_managed"; - case BF_SPACE_DISK_BACKED: return "disk_backed"; default: return "unknown"; } } @@ -320,8 +324,8 @@ BFstatus bfMalloc(void** ptr, BFsize size, BFspace space) { //printf("bfMalloc --> %p\n", data); break; } - case BF_SPACE_DISK_BACKED: { - int err = MMapMgr::get().alloc((void**)&data, size); + case BF_SPACE_MAPPED: { + int err = MappedMgr::get().alloc((void**)&data, size); BF_ASSERT(!err, BF_STATUS_MEM_ALLOC_FAILED); break; } @@ -357,7 +361,7 @@ BFstatus bfFree(void* ptr, BFspace space) { } switch( space ) { case BF_SPACE_SYSTEM: ::free(ptr); break; - case BF_SPACE_DISK_BACKED: MMapMgr::get().free(ptr); break; + case BF_SPACE_MAPPED: MappedMgr::get().free(ptr); break; #if defined BF_CUDA_ENABLED && BF_CUDA_ENABLED case BF_SPACE_CUDA: cudaFree(ptr); break; case BF_SPACE_CUDA_HOST: cudaFreeHost(ptr); break; @@ -386,13 +390,13 @@ BFstatus bfMemcpy(void* dst, #if defined BF_CUDA_ENABLED && BF_CUDA_ENABLED case BF_SPACE_CUDA_HOST: // fall-through #endif - case BF_SPACE_DISK_BACKED: // fall-through + case BF_SPACE_MAPPED: // fall-through case BF_SPACE_SYSTEM: { switch( dst_space ) { #if defined BF_CUDA_ENABLED && BF_CUDA_ENABLED case BF_SPACE_CUDA_HOST: // fall-through #endif - case BF_SPACE_DISK_BACKED: // fall-through + case BF_SPACE_MAPPED: // fall-through case BF_SPACE_SYSTEM: ::memcpy(dst, src, count); return BF_STATUS_SUCCESS; #if defined BF_CUDA_ENABLED && BF_CUDA_ENABLED case BF_SPACE_CUDA: kind = cudaMemcpyHostToDevice; break; @@ -406,6 +410,7 @@ BFstatus bfMemcpy(void* dst, case BF_SPACE_CUDA: { switch( dst_space ) { case BF_SPACE_CUDA_HOST: // fall-through + case BF_SPACE_MAPPED: // fall-through # TODO: Is this a good idea? case BF_SPACE_SYSTEM: kind = cudaMemcpyDeviceToHost; break; case BF_SPACE_CUDA: kind = cudaMemcpyDeviceToDevice; break; // TODO: BF_SPACE_CUDA_MANAGED @@ -461,7 +466,7 @@ BFstatus bfMemcpy2D(void* dst, #if defined BF_CUDA_ENABLED && BF_CUDA_ENABLED case BF_SPACE_CUDA_HOST: // fall-through #endif - case BF_SPACE_DISK_BACKED: // fall-through + case BF_SPACE_MAPPED: // fall-through case BF_SPACE_SYSTEM: { switch( dst_space ) { #if defined BF_CUDA_ENABLED && BF_CUDA_ENABLED @@ -481,6 +486,7 @@ BFstatus bfMemcpy2D(void* dst, case BF_SPACE_CUDA: { switch( dst_space ) { case BF_SPACE_CUDA_HOST: // fall-through + case BF_SPACE_MAPPED: // fall-through # TODO: Is this a good idea? case BF_SPACE_SYSTEM: kind = cudaMemcpyDeviceToHost; break; case BF_SPACE_CUDA: kind = cudaMemcpyDeviceToDevice; break; // TODO: Is this the right thing to do? @@ -514,7 +520,7 @@ BFstatus bfMemset(void* ptr, bfGetSpace(ptr, &space); } switch( space ) { - case BF_SPACE_DISK_BACKED: // fall-through + case BF_SPACE_MAPPED: // fall-through case BF_SPACE_SYSTEM: ::memset(ptr, value, count); break; #if defined BF_CUDA_ENABLED && BF_CUDA_ENABLED case BF_SPACE_CUDA_HOST: ::memset(ptr, value, count); break; @@ -552,11 +558,11 @@ BFstatus bfMemset2D(void* ptr, bfGetSpace(ptr, &space); } switch( space ) { - case BF_SPACE_DISK_BACKED: // fall-through + case BF_SPACE_MAPPED: // fall-through case BF_SPACE_SYSTEM: memset2D(ptr, stride, value, width, height); break; #if defined BF_CUDA_ENABLED && BF_CUDA_ENABLED case BF_SPACE_CUDA_HOST: memset2D(ptr, stride, value, width, height); break; - case BF_SPACE_CUDA: // Fall-through + case BF_SPACE_CUDA: // fall-through case BF_SPACE_CUDA_MANAGED: { BF_TRACE_STREAM(g_cuda_stream); BF_CHECK_CUDA(cudaMemset2DAsync(ptr, stride, value, width, height, g_cuda_stream), diff --git a/src/ring_impl.cpp b/src/ring_impl.cpp index 1e31a2f15..6388b296f 100644 --- a/src/ring_impl.cpp +++ b/src/ring_impl.cpp @@ -96,14 +96,14 @@ BFring_impl::BFring_impl(const char* name, BFspace space) #if defined BF_CUDA_ENABLED && BF_CUDA_ENABLED BF_ASSERT_EXCEPTION(space==BF_SPACE_SYSTEM || + space==BF_SPACE_MAPPED || space==BF_SPACE_CUDA || space==BF_SPACE_CUDA_HOST || - space==BF_SPACE_CUDA_MANAGED || - space==BF_SPACE_DISK_BACKED, + space==BF_SPACE_CUDA_MANAGED, BF_STATUS_INVALID_ARGUMENT); #else - BF_ASSERT_EXCEPTION(space==BF_SPACE_SYSTEM || - space==BF_SPACE_DISK_BACKED, + BF_ASSERT_EXCEPTION(space==BF_SPACE_SYSTEM || + space==BF_SPACE_MAPPED, BF_STATUS_INVALID_ARGUMENT); #endif diff --git a/src/utils.hpp b/src/utils.hpp index 710e3488b..1ac119fd3 100644 --- a/src/utils.hpp +++ b/src/utils.hpp @@ -209,10 +209,16 @@ byteswap(T value, T* result) { inline BFbool space_accessible_from(BFspace space, BFspace from) { #if !defined BF_CUDA_ENABLED || !BF_CUDA_ENABLED - return space == BF_SPACE_SYSTEM; + return ( (space == BF_SPACE_SYSTEM) + || (space == BF_SPACE_MAPPED) ); #else switch( from ) { +#if !defined BF_CUDA_ENABLED || !BF_CUDA_ENABLED + case BF_CUDA_HOST: // fall-through +#endif + case BF_SPACE_MAPPED: // fall-through case BF_SPACE_SYSTEM: return (space == BF_SPACE_SYSTEM || + space == BF_SPACE_MAPPED || space == BF_SPACE_CUDA_HOST || space == BF_SPACE_CUDA_MANAGED); case BF_SPACE_CUDA: return (space == BF_SPACE_CUDA || From 3e057bfc4a092ac2a21b889361e6c49a431b6867 Mon Sep 17 00:00:00 2001 From: jaycedowell Date: Mon, 30 Sep 2019 11:03:09 -0600 Subject: [PATCH 04/48] Typos. Missing file. So fun. --- python/bifrost/Space.py | 13 ++++++------- python/bifrost/memory.py | 2 +- src/bifrost/memory.h | 8 ++++---- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/python/bifrost/Space.py b/python/bifrost/Space.py index c3cbf0c7e..a70542f21 100644 --- a/python/bifrost/Space.py +++ b/python/bifrost/Space.py @@ -29,24 +29,23 @@ SPACEMAP_TO_STR = {_bf.BF_SPACE_AUTO: 'auto', _bf.BF_SPACE_SYSTEM: 'system', + _bf.BF_SPACE_MAPPED: 'mapped', _bf.BF_SPACE_CUDA: 'cuda', _bf.BF_SPACE_CUDA_HOST: 'cuda_host', - _bf.BF_SPACE_CUDA_MANAGED: 'cuda_managed', - _bf.BF_SPACE_DISK_BACKED: 'disk_backed'} + _bf.BF_SPACE_CUDA_MANAGED: 'cuda_managed'} SPACEMAP_FROM_STR = {'auto': _bf.BF_SPACE_AUTO, 'system': _bf.BF_SPACE_SYSTEM, + 'mapped': _bf.BF_SPACE_MAPPED, 'cuda': _bf.BF_SPACE_CUDA, 'cuda_host': _bf.BF_SPACE_CUDA_HOST, - 'cuda_managed': _bf.BF_SPACE_CUDA_MANAGED, - 'disk_backed': _bf.BF_SPACE_DISK_BACKED} + 'cuda_managed': _bf.BF_SPACE_CUDA_MANAGED} class Space(object): def __init__(self, s): if isinstance(s, basestring): - if s not in set(['auto', 'system', - 'cuda', 'cuda_host', 'cuda_managed', - 'disk_backed']): + if s not in set(['auto', 'system', 'mapped', + 'cuda', 'cuda_host', 'cuda_managed']): raise ValueError('Invalid space: %s' % s) self._space = s elif isinstance(s, _bf.BFspace) or isinstance(s, int): diff --git a/python/bifrost/memory.py b/python/bifrost/memory.py index d56019656..766b28f3b 100644 --- a/python/bifrost/memory.py +++ b/python/bifrost/memory.py @@ -42,7 +42,7 @@ def space_accessible(space, from_spaces): or 'cuda_managed' in from_spaces elif space == 'cuda_host': return 'system' in from_spaces \ - or 'mapped' in from_spaces + or 'mapped' in from_spaces \ or 'cuda_managed' in from_spaces elif space == 'cuda_managed': return 'system' in from_spaces \ diff --git a/src/bifrost/memory.h b/src/bifrost/memory.h index b14befb90..f79ae8a90 100644 --- a/src/bifrost/memory.h +++ b/src/bifrost/memory.h @@ -47,10 +47,10 @@ extern "C" { typedef enum BFspace_ { BF_SPACE_AUTO = 0, BF_SPACE_SYSTEM = 1, // aligned_alloc - BF_SPACE_CUDA = 2, // cudaMalloc - BF_SPACE_CUDA_HOST = 3, // cudaHostAlloc - BF_SPACE_CUDA_MANAGED = 4, // cudaMallocManaged - BF_SPACE_DISK_BACKED = 5 // disk-backed memory + BF_SPACE_MAPPED = 2, // mmapped to a file + BF_SPACE_CUDA = 3, // cudaMalloc + BF_SPACE_CUDA_HOST = 4, // cudaHostAlloc + BF_SPACE_CUDA_MANAGED = 5 // cudaMallocManaged } BFspace; BFstatus bfMalloc(void** ptr, BFsize size, BFspace space); From e48d2668fcaae39892ac33b2b6e08380fe7d7521 Mon Sep 17 00:00:00 2001 From: jaycedowell Date: Mon, 30 Sep 2019 12:34:30 -0600 Subject: [PATCH 05/48] Added flags to user.mk and Makefile to help control where the files associated with the mapped ring space live. --- src/Makefile | 4 ++++ user.mk | 2 ++ 2 files changed, 6 insertions(+) diff --git a/src/Makefile b/src/Makefile index 793b613f9..9d73f3123 100644 --- a/src/Makefile +++ b/src/Makefile @@ -100,6 +100,10 @@ ifdef ALIGNMENT CPPFLAGS += -DBF_ALIGNMENT=$(ALIGNMENT) endif +ifdef MAPPED_DIR + CPPFLAGS += -DBF_MAPPED_DIR=$(MAPPED_DIR) +endif + ifdef CUDA_DEBUG NVCCFLAGS += -G endif diff --git a/user.mk b/user.mk index 09f7be577..014aee137 100644 --- a/user.mk +++ b/user.mk @@ -20,6 +20,8 @@ CUDA_INCDIR ?= $(CUDA_HOME)/include ALIGNMENT ?= 4096 # Memory allocation alignment +#MAPPED_DIR ?= "/tmp/bifrost" # Mapped ring space file location + #NODEBUG = 1 # Disable debugging mode (use this for production releases) #TRACE = 1 # Enable tracing mode (generates annotations for use with nvprof/nvvp) #NOCUDA = 1 # Disable CUDA support From 40a5cb68206aa63c4154b5540ecb0f20bcc8c1fb Mon Sep 17 00:00:00 2001 From: jaycedowell Date: Mon, 30 Sep 2019 12:43:43 -0600 Subject: [PATCH 06/48] Renamed MAPPED_DIR to MAPPED_RING_DIR to make it a little more clear what it controls. --- src/Makefile | 4 ++-- src/memory.cpp | 6 +++--- user.mk | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Makefile b/src/Makefile index 9d73f3123..d823363f5 100644 --- a/src/Makefile +++ b/src/Makefile @@ -100,8 +100,8 @@ ifdef ALIGNMENT CPPFLAGS += -DBF_ALIGNMENT=$(ALIGNMENT) endif -ifdef MAPPED_DIR - CPPFLAGS += -DBF_MAPPED_DIR=$(MAPPED_DIR) +ifdef MAPPED_RING_DIR + CPPFLAGS += -DBF_MAPPED_RING_DIR=$(MAPPED_DIR) endif ifdef CUDA_DEBUG diff --git a/src/memory.cpp b/src/memory.cpp index a42bcd489..c27d6a294 100644 --- a/src/memory.cpp +++ b/src/memory.cpp @@ -50,8 +50,8 @@ static_assert(BF_IS_POW2(BF_ALIGNMENT), "BF_ALIGNMENT must be a power of 2"); #undef BF_IS_POW2 //static_assert(BF_ALIGNMENT >= 8, "BF_ALIGNMENT must be >= 8"); -#ifndef BF_MAPPED_DIR - #define BF_MAPPED_DIR "/tmp/bifrost" +#ifndef BF_MAPPED_RING_DIR + #define BF_MAPPED_RING_DIR "/tmp/bifrost" #endif void mmake_dir(std::string path, int perms=775) { @@ -113,7 +113,7 @@ class MLockFile { }; class MappedMgr { - static constexpr const char* base_mapdir = BF_MAPPED_DIR; + static constexpr const char* base_mapdir = BF_MAPPED_RING_DIR; std::string _mapdir; std::map _filenames; std::map _fds; diff --git a/user.mk b/user.mk index 014aee137..cc0c61a00 100644 --- a/user.mk +++ b/user.mk @@ -20,7 +20,7 @@ CUDA_INCDIR ?= $(CUDA_HOME)/include ALIGNMENT ?= 4096 # Memory allocation alignment -#MAPPED_DIR ?= "/tmp/bifrost" # Mapped ring space file location +#MAPPED_RING_DIR ?= "/tmp/bifrost" # Mapped ring space file location #NODEBUG = 1 # Disable debugging mode (use this for production releases) #TRACE = 1 # Enable tracing mode (generates annotations for use with nvprof/nvvp) From 388fd8cff4dee881d32820d65cc6673a3cf0dc6c Mon Sep 17 00:00:00 2001 From: jaycedowell Date: Wed, 2 Oct 2019 10:01:02 -0600 Subject: [PATCH 07/48] Added the mapped space into a couple of other places in Bifrost. --- python/bifrost/ndarray.py | 4 ++-- python/bifrost/pipeline.py | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/python/bifrost/ndarray.py b/python/bifrost/ndarray.py index db2d6c7b9..cf0e65855 100644 --- a/python/bifrost/ndarray.py +++ b/python/bifrost/ndarray.py @@ -90,8 +90,8 @@ def zeros(shape, dtype='f32', space=None, **kwargs): def copy_array(dst, src): dst_bf = asarray(dst) src_bf = asarray(src) - if (space_accessible(dst_bf.bf.space, ['system']) and - space_accessible(src_bf.bf.space, ['system'])): + if (space_accessible(dst_bf.bf.space, ['system',]) and # TODO: Should mapped be here as well? + space_accessible(src_bf.bf.space, ['system',])): np.copyto(dst_bf, src_bf) else: _check(_bf.bfArrayCopy(dst_bf.as_BFarray(), diff --git a/python/bifrost/pipeline.py b/python/bifrost/pipeline.py index 0676acd0a..d12412afa 100644 --- a/python/bifrost/pipeline.py +++ b/python/bifrost/pipeline.py @@ -171,6 +171,7 @@ def dot_graph(self, parent_graph=None): for oring in block.orings: space_colors = { 'system': 'orange', + 'mapped': 'goldenrod', 'cuda': 'limegreen', 'cuda_host': 'deepskyblue' } From 8258a1eeffcc8cafedac6628a31904dfb40f8396 Mon Sep 17 00:00:00 2001 From: jaycedowell Date: Wed, 2 Oct 2019 11:07:56 -0600 Subject: [PATCH 08/48] Added a missing BF_SPACE_MAPPED case to bfMemcpy2D. --- src/memory.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/memory.cpp b/src/memory.cpp index c27d6a294..1a6d760e7 100644 --- a/src/memory.cpp +++ b/src/memory.cpp @@ -472,6 +472,7 @@ BFstatus bfMemcpy2D(void* dst, #if defined BF_CUDA_ENABLED && BF_CUDA_ENABLED case BF_SPACE_CUDA_HOST: // fall-through #endif + case BF_SPACE_MAPPED: // fall-through case BF_SPACE_SYSTEM: memcpy2D(dst, dst_stride, src, src_stride, width, height); return BF_STATUS_SUCCESS; #if defined BF_CUDA_ENABLED && BF_CUDA_ENABLED case BF_SPACE_CUDA: kind = cudaMemcpyHostToDevice; break; From fb2c49e34be5668c650b2c6fddb74e5b31390ffd Mon Sep 17 00:00:00 2001 From: jaycedowell Date: Wed, 2 Oct 2019 13:45:19 -0600 Subject: [PATCH 09/48] Cleaned up the typing and naming inside the MappedMgr class. --- src/memory.cpp | 75 ++++++++++++++++++++++++-------------------------- 1 file changed, 36 insertions(+), 39 deletions(-) diff --git a/src/memory.cpp b/src/memory.cpp index 1a6d760e7..62fbc6ba2 100644 --- a/src/memory.cpp +++ b/src/memory.cpp @@ -113,30 +113,30 @@ class MLockFile { }; class MappedMgr { - static constexpr const char* base_mapdir = BF_MAPPED_RING_DIR; - std::string _mapdir; - std::map _filenames; - std::map _fds; - std::map _lengths; + static constexpr const char* base_mapped_dir = BF_MAPPED_RING_DIR; + std::string _mapped_dir; + std::map _filenames; + std::map _fds; + std::map _lengths; - void try_base_mapdir_cleanup() { + void try_base_mapped_dir_cleanup() { // Do this with a file lock to avoid interference from other processes - MLockFile lock(std::string(base_mapdir) + ".lock"); + MLockFile lock(std::string(base_mapped_dir) + ".lock"); DIR* dp; // Remove pid dirs for which a corresponding process does not exist - if( (dp = opendir(base_mapdir)) ) { + if( (dp = opendir(base_mapped_dir)) ) { struct dirent* ep; while( (ep = readdir(dp)) ) { pid_t pid = atoi(ep->d_name); if( pid && !mprocess_exists(pid) ) { - mremove_all(std::string(base_mapdir) + "/" + + mremove_all(std::string(base_mapped_dir) + "/" + std::to_string(pid)); } } closedir(dp); } // Remove the base_logdir if it's empty - try { mremove_dir(base_mapdir); } + try { mremove_dir(base_mapped_dir); } catch( std::exception ) {} } void cleanup(std::string filename, int fd) { @@ -147,20 +147,18 @@ class MappedMgr { catch( std::exception ) {} } MappedMgr() - : _mapdir(std::string(base_mapdir) + "/" + std::to_string(getpid())) { - this->try_base_mapdir_cleanup(); - mmake_dir(base_mapdir, 777); - mmake_dir(_mapdir); + : _mapped_dir(std::string(base_mapped_dir) + "/" + std::to_string(getpid())) { + this->try_base_mapped_dir_cleanup(); + mmake_dir(base_mapped_dir, 777); + mmake_dir(_mapped_dir); } ~MappedMgr() { - void** data; for(auto& x : _filenames) { - data = x.first; - this->free(*data); + this->free(x.first); } try { - mremove_all(_mapdir); - this->try_base_mapdir_cleanup(); + mremove_all(_mapped_dir); + this->try_base_mapped_dir_cleanup(); } catch( std::exception ) {} } public: @@ -170,7 +168,7 @@ class MappedMgr { static MappedMgr mm; return mm; } - inline bool is_mmap(void** data) { + inline bool is_mapped(void* data) const { if( _filenames.count(data) == 0 ) { return false; } else { @@ -180,11 +178,11 @@ class MappedMgr { int alloc(void** data, BFsize size) { // Create char tempname[256]; - strcpy(tempname, _mapdir.c_str()); + strcpy(tempname, _mapped_dir.c_str()); strcat(tempname, "/mmapXXXXXX"); int fd = ::mkstemp(tempname); std::string filename = std::string(tempname); - std::cout << "filename: " << filename << std::endl; + //std::cout << "filename: " << filename << std::endl; if( fd < 0 ) { this->cleanup(filename, fd); return 1; @@ -208,44 +206,43 @@ class MappedMgr { ::madvise(*data, size, MADV_SEQUENTIAL); // Save and return - _filenames[data] = filename; - _fds[data] = fd; - _lengths[data] = size; + _filenames[*data] = filename; + _fds[*data] = fd; + _lengths[*data] = size; return 0; } int sync(void* data) { - if( !this->is_mmap((void**)&data) ) { + if( !this->is_mapped(data) ) { return -1; } - BFsize length = _lengths[(void**)&data]; - return ::msync(data, length, MS_ASYNC|MS_INVALIDATE); + return ::msync(data, _lengths[data], MS_ASYNC|MS_INVALIDATE); } void* memcpy(void* dest, void* src, BFsize count) { ::memcpy(dest, src, count); - if( this->is_mmap((void**)&dest) ) { + if( this->is_mapped(dest) ) { this->sync(dest); } return dest; } void* memset(void* dest, int ch, BFsize count) { ::memset(dest, ch, count); - if( this->is_mmap((void**)&dest) ) { + if( this->is_mapped(dest) ) { this->sync(dest); } return dest; } int free(void* data) { - if( !this->is_mmap((void**)&data) ) { + if( !this->is_mapped(data) ) { return -1; } - std::string filename = _filenames[(void**)&data]; - _filenames.erase((void**)&data); - int fd = _fds[(void**)&data]; - _fds.erase((void**)&data); - BFsize length = _lengths[(void**)&data]; - _lengths.erase((void**)&data); + std::string filename = _filenames[data]; + _filenames.erase(data); + int fd = _fds[data]; + _fds.erase(data); + BFsize length = _lengths[data]; + _lengths.erase(data); ::munmap(data, length); this->cleanup(filename, fd); @@ -256,7 +253,7 @@ class MappedMgr { BFstatus bfGetSpace(const void* ptr, BFspace* space) { BF_ASSERT(ptr, BF_STATUS_INVALID_POINTER); #if !defined BF_CUDA_ENABLED || !BF_CUDA_ENABLED - if( MappedMgr::get().is_mmap((void**)&ptr) ) { + if( MappedMgr::get().is_mapped((void*) ptr) ) { *space = BF_SPACE_MAPPED; } else { *space = BF_SPACE_SYSTEM; @@ -272,7 +269,7 @@ BFstatus bfGetSpace(const void* ptr, BFspace* space) { // up in cuda-memcheck? // Note: cudaPointerGetAttributes only works for memory allocated with // CUDA API functions, so if it fails we just assume sysmem. - if( MappedMgr::get().is_mmap((void**)&ptr) ) { + if( MappedMgr::get().is_mapped((void*) ptr) ) { *space = BF_SPACE_MAPPED; } else { *space = BF_SPACE_SYSTEM; From 23c475197d35960642206a03140677661710208b Mon Sep 17 00:00:00 2001 From: jaycedowell Date: Wed, 2 Oct 2019 13:53:59 -0600 Subject: [PATCH 10/48] Hacked in a few quick tests for the mapped ring space. --- test/test_pipeline.py | 6 ++++-- test/test_pipeline_cpu.py | 33 +++++++++++++++++++++++++-------- 2 files changed, 29 insertions(+), 10 deletions(-) diff --git a/test/test_pipeline.py b/test/test_pipeline.py index b9d8f1327..91eb04e47 100644 --- a/test/test_pipeline.py +++ b/test/test_pipeline.py @@ -113,14 +113,14 @@ def setUp(self): # ring buffer at least a few times over in order to properly # test things. self.fil_file = "./data/2chan16bitNoDM.fil" - def test_cuda_copy(self): + def test_cuda_copy(self, space='system'): def check_sequence(seq): pass def check_data(ispan): pass gulp_nframe = 101 with bf.Pipeline() as pipeline: - data = read_sigproc([self.fil_file], gulp_nframe) + data = read_sigproc([self.fil_file], gulp_nframe, space=space) for _ in xrange(10): data = copy(data, space='cuda') data = copy(data, space='cuda_host') @@ -129,6 +129,8 @@ def check_data(ispan): pipeline.run() self.assertEqual(ref['idata'].dtype, 'uint16') self.assertEqual(ref['idata'].shape, (29, 1, 2)) + def test_cuda_copy_mapped(self): + self.test_cuda_copy(space='mapped') def test_fdmt(self): gulp_nframe = 101 # TODO: Check handling of multiple pols (not currently supported?) diff --git a/test/test_pipeline_cpu.py b/test/test_pipeline_cpu.py index 64a095416..b0607a26d 100644 --- a/test/test_pipeline_cpu.py +++ b/test/test_pipeline_cpu.py @@ -79,7 +79,7 @@ def setUp(self): # ring buffer at least a few times over in order to properly # test things. self.fil_file = "./data/2chan16bitNoDM.fil" - def test_read_sigproc(self): + def test_read_sigproc(self, space='system'): gulp_nframe = 101 def check_sequence(seq): tensor = seq.header['_tensor'] @@ -93,11 +93,13 @@ def check_data(ispan, ospan): self.assertEqual(ispan.data.shape, (ispan.nframe,1,2)) self.assertEqual(ospan.data.shape, (ospan.nframe,1,2)) with bf.Pipeline() as pipeline: - data = read_sigproc([self.fil_file], gulp_nframe) - data = CallbackBlock(data, check_sequence, check_data) + data = read_sigproc([self.fil_file], gulp_nframe, space=space) + data = CallbackBlock(data, check_sequence, check_data, space='system') pipeline.run() + def test_read_sigproc_mapped(self): + self.test_read_sigproc(space='mapped') def run_test_simple_copy(self, guarantee, test_views=False, - gulp_nframe_inc=0): + gulp_nframe_inc=0, space='system'): def check_sequence(seq): hdr = seq.header tensor = hdr['_tensor'] @@ -110,7 +112,7 @@ def check_data(ispan, ospan): pass gulp_nframe = 101 with bf.Pipeline() as pipeline: - data = read_sigproc([self.fil_file], gulp_nframe) + data = read_sigproc([self.fil_file], gulp_nframe, space=space) if test_views: data = bf.views.split_axis(data, 'freq', 2, 'fine_freq') data = bf.views.merge_axes(data, 'freq', 'fine_freq') @@ -131,29 +133,44 @@ def check_data(ispan, ospan): for i in xrange(20): if gulp_nframe_inc != 0: data = copy(data, guarantee=guarantee, - gulp_nframe=gulp_nframe+i*gulp_nframe_inc) + gulp_nframe=gulp_nframe+i*gulp_nframe_inc, + space=space) else: - data = copy(data, guarantee=guarantee) + data = copy(data, guarantee=guarantee, space=space) data = copy(data, guarantee=guarantee, gulp_nframe=gulp_nframe) ref = {} - data = CallbackBlock(data, check_sequence, check_data, data_ref=ref) + data = CallbackBlock(data, check_sequence, check_data, data_ref=ref, space='system') pipeline.run() self.assertEqual(ref['odata'].dtype, 'uint16') self.assertEqual(ref['odata'].shape, (29, 1, 2)) def test_simple_copy(self): self.run_test_simple_copy(guarantee=True) + def test_simple_copy_mapped(self): + self.run_test_simple_copy(guarantee=True, space='mapped') def test_simple_copy_unguaranteed(self): self.run_test_simple_copy(guarantee=False) + def test_ssimple_copy_unguaranteed_mapped(self): + self.run_test_simple_copy(guarantee=False, space='mapped') def test_simple_copy_mixed_gulp_nframe(self): self.run_test_simple_copy(guarantee=True, gulp_nframe_inc=1) self.run_test_simple_copy(guarantee=True, gulp_nframe_inc=3) + def test_simple_copy_mixed_gulp_nframe_mapped(self): + self.run_test_simple_copy(guarantee=True, gulp_nframe_inc=1, space='mapped') + self.run_test_simple_copy(guarantee=True, gulp_nframe_inc=3, space='mapped') def test_simple_copy_mixed_gulp_nframe_unguaranteed(self): self.run_test_simple_copy(guarantee=False, gulp_nframe_inc=1) self.run_test_simple_copy(guarantee=False, gulp_nframe_inc=3) + def test_simple_copy_mixed_gulp_nframe_unguaranteed_mapped(self): + self.run_test_simple_copy(guarantee=False, gulp_nframe_inc=1, space='mapped') + self.run_test_simple_copy(guarantee=False, gulp_nframe_inc=3, space='mapped') def test_simple_views(self): self.run_test_simple_copy(guarantee=True, test_views=True) + def test_simple_views_mapped(self): + self.run_test_simple_copy(guarantee=True, test_views=True, space='mapped') def test_simple_views_unguaranteed(self): self.run_test_simple_copy(guarantee=False, test_views=True) + def test_simple_views_unguaranteed_mapped(self): + self.run_test_simple_copy(guarantee=False, test_views=True, space='mapped') def test_block_chainer(self): with bf.Pipeline() as pipeline: bc = bf.BlockChainer() From 9ded2aa4fb976a85a04054d4b4f8cd903d15daae Mon Sep 17 00:00:00 2001 From: jaycedowell Date: Wed, 2 Oct 2019 14:14:37 -0600 Subject: [PATCH 11/48] And a few more tests that involve the mapped space. --- test/test_serialize.py | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/test/test_serialize.py b/test/test_serialize.py index 123e5fb8c..f97ebbefb 100644 --- a/test/test_serialize.py +++ b/test/test_serialize.py @@ -83,9 +83,9 @@ def setUp(self): self.basename = os.path.basename(self.fil_file) self.basepath = os.path.join(self.temp_path, self.basename) self.gulp_nframe = 101 - def run_test_serialize_with_name_no_ringlets(self, gulp_nframe_inc=0): + def run_test_serialize_with_name_no_ringlets(self, gulp_nframe_inc=0, space='system'): with bf.Pipeline() as pipeline: - data = read_sigproc([self.fil_file], self.gulp_nframe, core=0) + data = read_sigproc([self.fil_file], self.gulp_nframe, core=0, space='mapped') for i in xrange(5): if gulp_nframe_inc != 0: data = copy(data, @@ -108,9 +108,13 @@ def test_serialize_with_name_no_ringlets(self): self.run_test_serialize_with_name_no_ringlets() self.run_test_serialize_with_name_no_ringlets(gulp_nframe_inc=1) self.run_test_serialize_with_name_no_ringlets(gulp_nframe_inc=3) - def test_serialize_with_time_tag_no_ringlets(self): + def test_serialize_with_name_no_ringlets_mapped(self): + self.run_test_serialize_with_name_no_ringlets(space='mapped') + self.run_test_serialize_with_name_no_ringlets(gulp_nframe_inc=1, space='mapped') + self.run_test_serialize_with_name_no_ringlets(gulp_nframe_inc=3, space='mapped') + def test_serialize_with_time_tag_no_ringlets(self, space='system'): with bf.Pipeline() as pipeline: - data = read_sigproc([self.fil_file], self.gulp_nframe) + data = read_sigproc([self.fil_file], self.gulp_nframe, space=space) # Custom view sets sequence name to '', which causes SerializeBlock # to use the time_tag instead. data = bf.views.custom(data, lambda hdr: rename_sequence(hdr, '')) @@ -127,9 +131,11 @@ def test_serialize_with_time_tag_no_ringlets(self): with open(datpath, 'rb') as f: data = f.read() self.assertEqual(data, self.data) - def test_serialize_with_name_and_ringlets(self): + def test_serialize_with_time_tag_no_ringlets_mapped(self): + self.test_serialize_with_time_tag_no_ringlets(space='mapped') + def test_serialize_with_name_and_ringlets(self, space='system'): with bf.Pipeline() as pipeline: - data = read_sigproc([self.fil_file], self.gulp_nframe) + data = read_sigproc([self.fil_file], self.gulp_nframe, space=space) # Transpose so that freq becomes a ringlet dimension # TODO: Test multiple ringlet dimensions (e.g., freq + pol) once # SerializeBlock supports it. @@ -148,10 +154,12 @@ def test_serialize_with_name_and_ringlets(self): self.data_size // 2) self.assertEqual(os.path.getsize(datpath1), self.data_size // 2) - def test_deserialize_no_ringlets(self): + def test_serialize_with_name_and_ringlets_mapped(self): + self.test_serialize_with_name_and_ringlets(space='mapped') + def test_deserialize_no_ringlets(self, space='system'): with TemporaryDirectory(self.temp_path): with bf.Pipeline() as pipeline: - data = read_sigproc([self.fil_file], self.gulp_nframe) + data = read_sigproc([self.fil_file], self.gulp_nframe, space=space) serialize(data, self.temp_path) pipeline.run() datpath = self.basepath + '.bf.' + '0' * 12 + '.dat' @@ -168,10 +176,12 @@ def test_deserialize_no_ringlets(self): data = f.read() self.assertEqual(len(data), len(self.data)) self.assertEqual(data, self.data) - def test_deserialize_with_ringlets(self): + def test_deserialize_no_ringlets_mapped(self): + self.test_deserialize_no_ringlets(space='mapped') + def test_deserialize_with_ringlets(self, space='system'): with TemporaryDirectory(self.temp_path): with bf.Pipeline() as pipeline: - data = read_sigproc([self.fil_file], self.gulp_nframe) + data = read_sigproc([self.fil_file], self.gulp_nframe, space=space) data = transpose(data, ['freq', 'time', 'pol']) serialize(data, self.temp_path) pipeline.run() @@ -194,3 +204,5 @@ def test_deserialize_with_ringlets(self): self.data_size // 2) self.assertEqual(os.path.getsize(datpath1), self.data_size // 2) + def test_deserialize_with_ringlets_mapped(self): + self.test_deserialize_with_ringlets(space='mapped') \ No newline at end of file From 817979e23f3626a48e721d909089a3c16a1aa7d2 Mon Sep 17 00:00:00 2001 From: jaycedowell Date: Wed, 2 Oct 2019 14:27:53 -0600 Subject: [PATCH 12/48] More cleanup in the MappedMgr class. --- src/memory.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/memory.cpp b/src/memory.cpp index 62fbc6ba2..c758e7123 100644 --- a/src/memory.cpp +++ b/src/memory.cpp @@ -237,15 +237,11 @@ class MappedMgr { return -1; } - std::string filename = _filenames[data]; + ::munmap(data, _lengths[data]); + this->cleanup(_filenames[data], _fds[data]); _filenames.erase(data); - int fd = _fds[data]; _fds.erase(data); - BFsize length = _lengths[data]; _lengths.erase(data); - - ::munmap(data, length); - this->cleanup(filename, fd); return 0; } }; @@ -297,7 +293,6 @@ const char* bfGetSpaceString(BFspace space) { // coding all of these values twice (one in memory.h for the // enum, once here)? - switch( space ) { case BF_SPACE_AUTO: return "auto"; case BF_SPACE_SYSTEM: return "system"; From 5d0a9e3d32d5325954e63caec1ec454b5327883e Mon Sep 17 00:00:00 2001 From: jaycedowell Date: Wed, 2 Oct 2019 15:47:09 -0600 Subject: [PATCH 13/48] Updated the dates in the files that were modified as part of this branch. --- python/bifrost/Space.py | 2 +- python/bifrost/libbifrost.py | 2 +- python/bifrost/memory.py | 2 +- src/bifrost/memory.h | 2 +- src/memory.cpp | 2 +- src/ring_impl.cpp | 2 +- src/utils.hpp | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/python/bifrost/Space.py b/python/bifrost/Space.py index a70542f21..4349eeb54 100644 --- a/python/bifrost/Space.py +++ b/python/bifrost/Space.py @@ -1,5 +1,5 @@ -# Copyright (c) 2016, The Bifrost Authors. All rights reserved. +# Copyright (c) 2016-2019, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions diff --git a/python/bifrost/libbifrost.py b/python/bifrost/libbifrost.py index fe63cf801..7a1e1dc08 100644 --- a/python/bifrost/libbifrost.py +++ b/python/bifrost/libbifrost.py @@ -1,5 +1,5 @@ -# Copyright (c) 2016, The Bifrost Authors. All rights reserved. +# Copyright (c) 2016-2019, The Bifrost Authors. All rights reserved. # Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. # # Redistribution and use in source and binary forms, with or without diff --git a/python/bifrost/memory.py b/python/bifrost/memory.py index 766b28f3b..4897475ba 100644 --- a/python/bifrost/memory.py +++ b/python/bifrost/memory.py @@ -1,5 +1,5 @@ -# Copyright (c) 2016, The Bifrost Authors. All rights reserved. +# Copyright (c) 2016-2019, The Bifrost Authors. All rights reserved. # Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. # # Redistribution and use in source and binary forms, with or without diff --git a/src/bifrost/memory.h b/src/bifrost/memory.h index f79ae8a90..e8af7437d 100644 --- a/src/bifrost/memory.h +++ b/src/bifrost/memory.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, The Bifrost Authors. All rights reserved. + * Copyright (c) 2016-2019, The Bifrost Authors. All rights reserved. * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/src/memory.cpp b/src/memory.cpp index c758e7123..d3d6474ca 100644 --- a/src/memory.cpp +++ b/src/memory.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, The Bifrost Authors. All rights reserved. + * Copyright (c) 2016-2019, The Bifrost Authors. All rights reserved. * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/src/ring_impl.cpp b/src/ring_impl.cpp index 6388b296f..05994e994 100644 --- a/src/ring_impl.cpp +++ b/src/ring_impl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, The Bifrost Authors. All rights reserved. + * Copyright (c) 2016-2019, The Bifrost Authors. All rights reserved. * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/src/utils.hpp b/src/utils.hpp index 1ac119fd3..7c8e28c95 100644 --- a/src/utils.hpp +++ b/src/utils.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, The Bifrost Authors. All rights reserved. + * Copyright (c) 2016-2019, The Bifrost Authors. All rights reserved. * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. * * Redistribution and use in source and binary forms, with or without From a74f24da4916271c7e16e0df5b1edde9a8afb0d7 Mon Sep 17 00:00:00 2001 From: jaycedowell Date: Fri, 8 Nov 2019 17:12:01 -0700 Subject: [PATCH 14/48] Fixed a problem specifying the MAPPED_RING_DIR path in user.mk. --- src/Makefile | 2 +- user.mk | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Makefile b/src/Makefile index d823363f5..e333d1dce 100644 --- a/src/Makefile +++ b/src/Makefile @@ -101,7 +101,7 @@ ifdef ALIGNMENT endif ifdef MAPPED_RING_DIR - CPPFLAGS += -DBF_MAPPED_RING_DIR=$(MAPPED_DIR) + CPPFLAGS += -DBF_MAPPED_RING_DIR='"$(strip $(MAPPED_RING_DIR))"' endif ifdef CUDA_DEBUG diff --git a/user.mk b/user.mk index cc0c61a00..c0f5e1fa9 100644 --- a/user.mk +++ b/user.mk @@ -20,7 +20,7 @@ CUDA_INCDIR ?= $(CUDA_HOME)/include ALIGNMENT ?= 4096 # Memory allocation alignment -#MAPPED_RING_DIR ?= "/tmp/bifrost" # Mapped ring space file location +#MAPPED_RING_DIR ?= /tmp/bifrost # Mapped ring space file location #NODEBUG = 1 # Disable debugging mode (use this for production releases) #TRACE = 1 # Enable tracing mode (generates annotations for use with nvprof/nvvp) From 120da36bf71365d69e40853d4374a89216c05381 Mon Sep 17 00:00:00 2001 From: jaycedowell Date: Mon, 11 Nov 2019 13:42:26 -0700 Subject: [PATCH 15/48] Updated the version of PyPy used for testing. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index ef5e73fd1..61f3ce06e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,7 @@ language: python python: - 2.7 # PyPy versions - - pypy-5.4.1 + - pypy2.7-6.0 services: - docker From f9ed7bc1e758ec8f88925dedc483b018f63b9287 Mon Sep 17 00:00:00 2001 From: jaycedowell Date: Wed, 18 Mar 2020 13:08:25 -0600 Subject: [PATCH 16/48] Moved all of the file locking and directory managment features into fileutils.hpp a la PR #132. --- src/fileutils.hpp | 99 +++++++++++++++++++++++++++++++++++++++++++++++ src/memory.cpp | 79 ++++++------------------------------- src/proclog.cpp | 63 +----------------------------- 3 files changed, 112 insertions(+), 129 deletions(-) create mode 100644 src/fileutils.hpp diff --git a/src/fileutils.hpp b/src/fileutils.hpp new file mode 100644 index 000000000..68bd3887c --- /dev/null +++ b/src/fileutils.hpp @@ -0,0 +1,99 @@ +/* + * Copyright (c) 2016-2020, The Bifrost Authors. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of The Bifrost Authors nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#pragma once + +#include // For flock +#include // For fstat +#include // For getpid +#include // For getpid +#include + +inline void make_dir(std::string path, int perms=775) { + if( std::system(("mkdir -p "+path+" -m "+std::to_string(perms)).c_str()) ) { + throw std::runtime_error("Failed to create path: "+path); + } +} +inline void remove_all(std::string path) { + if( std::system(("rm -rf "+path).c_str()) ) { + throw std::runtime_error("Failed to remove all: "+path); + } +} +inline void remove_dir(std::string path) { + if( std::system(("rmdir "+path+" 2> /dev/null").c_str()) ) { + throw std::runtime_error("Failed to remove dir: "+path); + } +} +inline void remove_file(std::string path) { + if( std::system(("rm -f "+path).c_str()) ) { + throw std::runtime_error("Failed to remove file: "+path); + } +} +inline bool file_exists(std::string path) { + struct stat s; + return !(stat(path.c_str(), &s) == -1 + && errno == ENOENT); +} +inline bool process_exists(pid_t pid) { + struct stat s; + return !(stat(("/proc/"+std::to_string(pid)).c_str(), &s) == -1 + && errno == ENOENT); +} + +inline std::string get_dirname(std::string filename) { + // TODO: This is crude, but works for our proclog use-case + return filename.substr(0, filename.find_last_of("/")); +} + +class LockFile { + std::string _lockfile; + int _fd; +public: + LockFile(LockFile const& ) = delete; + LockFile& operator=(LockFile const& ) = delete; + LockFile(std::string lockfile) : _lockfile(lockfile) { + while( true ) { + _fd = open(_lockfile.c_str(), O_CREAT, 600); + flock(_fd, LOCK_EX); + struct stat fd_stat, lockfile_stat; + fstat(_fd, &fd_stat); + stat(_lockfile.c_str(), &lockfile_stat); + // Compare inodes + if( fd_stat.st_ino == lockfile_stat.st_ino ) { + // Got the lock + break; + } + close(_fd); + } + } + ~LockFile() { + unlink(_lockfile.c_str()); + flock(_fd, LOCK_UN); + } +}; + diff --git a/src/memory.cpp b/src/memory.cpp index d3d6474ca..6e7c541e1 100644 --- a/src/memory.cpp +++ b/src/memory.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2019, The Bifrost Authors. All rights reserved. + * Copyright (c) 2016-2020, The Bifrost Authors. All rights reserved. * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -31,6 +31,7 @@ #include "utils.hpp" #include "cuda.hpp" #include "trace.hpp" +#include "fileutils.hpp" #include // For posix_memalign #include // For memcpy @@ -54,64 +55,6 @@ static_assert(BF_IS_POW2(BF_ALIGNMENT), "BF_ALIGNMENT must be a power of 2"); #define BF_MAPPED_RING_DIR "/tmp/bifrost" #endif -void mmake_dir(std::string path, int perms=775) { - if( std::system(("mkdir -p "+path+" -m "+std::to_string(perms)).c_str()) ) { - throw std::runtime_error("Failed to create path: "+path); - } -} -void mremove_all(std::string path) { - if( std::system(("rm -rf "+path).c_str()) ) { - throw std::runtime_error("Failed to remove all: "+path); - } -} -void mremove_dir(std::string path) { - if( std::system(("rmdir "+path+" 2> /dev/null").c_str()) ) { - throw std::runtime_error("Failed to remove dir: "+path); - } -} -void mremove_file(std::string path) { - if( std::system(("rm -f "+path).c_str()) ) { - throw std::runtime_error("Failed to remove file: "+path); - } -} -bool mprocess_exists(pid_t pid) { - struct stat s; - return !(stat(("/proc/"+std::to_string(pid)).c_str(), &s) == -1 - && errno == ENOENT); -} - -std::string mget_dirname(std::string filename) { - // TODO: This is crude, but works for our proclog use-case - return filename.substr(0, filename.find_last_of("/")); -} - -class MLockFile { - std::string _lockfile; - int _fd; -public: - MLockFile(MLockFile const& ) = delete; - MLockFile& operator=(MLockFile const& ) = delete; - MLockFile(std::string lockfile) : _lockfile(lockfile) { - while( true ) { - _fd = open(_lockfile.c_str(), O_CREAT, 600); - flock(_fd, LOCK_EX); - struct stat fd_stat, lockfile_stat; - fstat(_fd, &fd_stat); - stat(_lockfile.c_str(), &lockfile_stat); - // Compare inodes - if( fd_stat.st_ino == lockfile_stat.st_ino ) { - // Got the lock - break; - } - close(_fd); - } - } - ~MLockFile() { - unlink(_lockfile.c_str()); - flock(_fd, LOCK_UN); - } -}; - class MappedMgr { static constexpr const char* base_mapped_dir = BF_MAPPED_RING_DIR; std::string _mapped_dir; @@ -121,43 +64,43 @@ class MappedMgr { void try_base_mapped_dir_cleanup() { // Do this with a file lock to avoid interference from other processes - MLockFile lock(std::string(base_mapped_dir) + ".lock"); + LockFile lock(std::string(base_mapped_dir) + ".lock"); DIR* dp; // Remove pid dirs for which a corresponding process does not exist if( (dp = opendir(base_mapped_dir)) ) { struct dirent* ep; while( (ep = readdir(dp)) ) { pid_t pid = atoi(ep->d_name); - if( pid && !mprocess_exists(pid) ) { - mremove_all(std::string(base_mapped_dir) + "/" + - std::to_string(pid)); + if( pid && !process_exists(pid) ) { + remove_all(std::string(base_mapped_dir) + "/" + + std::to_string(pid)); } } closedir(dp); } // Remove the base_logdir if it's empty - try { mremove_dir(base_mapped_dir); } + try { remove_dir(base_mapped_dir); } catch( std::exception ) {} } void cleanup(std::string filename, int fd) { if( fd >= 0 ) { ::close(fd); } - try { mremove_file(filename); } + try { remove_file(filename); } catch( std::exception ) {} } MappedMgr() : _mapped_dir(std::string(base_mapped_dir) + "/" + std::to_string(getpid())) { this->try_base_mapped_dir_cleanup(); - mmake_dir(base_mapped_dir, 777); - mmake_dir(_mapped_dir); + make_dir(base_mapped_dir, 777); + make_dir(_mapped_dir); } ~MappedMgr() { for(auto& x : _filenames) { this->free(x.first); } try { - mremove_all(_mapped_dir); + remove_all(_mapped_dir); this->try_base_mapped_dir_cleanup(); } catch( std::exception ) {} } diff --git a/src/proclog.cpp b/src/proclog.cpp index c3ce56801..303ea173f 100644 --- a/src/proclog.cpp +++ b/src/proclog.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, The Bifrost Authors. All rights reserved. + * Copyright (c) 2016-2020, The Bifrost Authors. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -29,12 +29,11 @@ #include #include "trace.hpp" #include "proclog.hpp" +#include "fileutils.hpp" #include #include // For system #include // For va_start, va_list, va_end -#include // For flock -#include // For fstat #include // For getpid #include // For opendir, readdir, closedir #include // For getpid @@ -42,64 +41,6 @@ #include #include -void make_dir(std::string path, int perms=775) { - if( std::system(("mkdir -p "+path+" -m "+std::to_string(perms)).c_str()) ) { - throw std::runtime_error("Failed to create path: "+path); - } -} -void remove_all(std::string path) { - if( std::system(("rm -rf "+path).c_str()) ) { - throw std::runtime_error("Failed to remove all: "+path); - } -} -void remove_dir(std::string path) { - if( std::system(("rmdir "+path+" 2> /dev/null").c_str()) ) { - throw std::runtime_error("Failed to remove dir: "+path); - } -} -void remove_file(std::string path) { - if( std::system(("rm -f "+path).c_str()) ) { - throw std::runtime_error("Failed to remove file: "+path); - } -} -bool process_exists(pid_t pid) { - struct stat s; - return !(stat(("/proc/"+std::to_string(pid)).c_str(), &s) == -1 - && errno == ENOENT); -} - -std::string get_dirname(std::string filename) { - // TODO: This is crude, but works for our proclog use-case - return filename.substr(0, filename.find_last_of("/")); -} - -class LockFile { - std::string _lockfile; - int _fd; -public: - LockFile(LockFile const& ) = delete; - LockFile& operator=(LockFile const& ) = delete; - LockFile(std::string lockfile) : _lockfile(lockfile) { - while( true ) { - _fd = open(_lockfile.c_str(), O_CREAT, 600); - flock(_fd, LOCK_EX); - struct stat fd_stat, lockfile_stat; - fstat(_fd, &fd_stat); - stat(_lockfile.c_str(), &lockfile_stat); - // Compare inodes - if( fd_stat.st_ino == lockfile_stat.st_ino ) { - // Got the lock - break; - } - close(_fd); - } - } - ~LockFile() { - unlink(_lockfile.c_str()); - flock(_fd, LOCK_UN); - } -}; - class ProcLogMgr { static constexpr const char* base_logdir = "/dev/shm/bifrost"; std::string _logdir; From 9a6750db4a6529f11039c58e10f054008bca8568 Mon Sep 17 00:00:00 2001 From: jaycedowell Date: Wed, 18 Mar 2020 13:16:05 -0600 Subject: [PATCH 17/48] Formatting cleanup in memory.cpp. --- src/memory.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/memory.cpp b/src/memory.cpp index 6e7c541e1..40c52558b 100644 --- a/src/memory.cpp +++ b/src/memory.cpp @@ -239,7 +239,7 @@ const char* bfGetSpaceString(BFspace space) { switch( space ) { case BF_SPACE_AUTO: return "auto"; case BF_SPACE_SYSTEM: return "system"; - case BF_SPACE_MAPPED: return "mapped"; + case BF_SPACE_MAPPED: return "mapped"; case BF_SPACE_CUDA: return "cuda"; case BF_SPACE_CUDA_HOST: return "cuda_host"; case BF_SPACE_CUDA_MANAGED: return "cuda_managed"; @@ -296,7 +296,7 @@ BFstatus bfFree(void* ptr, BFspace space) { } switch( space ) { case BF_SPACE_SYSTEM: ::free(ptr); break; - case BF_SPACE_MAPPED: MappedMgr::get().free(ptr); break; + case BF_SPACE_MAPPED: MappedMgr::get().free(ptr); break; #if defined BF_CUDA_ENABLED && BF_CUDA_ENABLED case BF_SPACE_CUDA: cudaFree(ptr); break; case BF_SPACE_CUDA_HOST: cudaFreeHost(ptr); break; @@ -325,13 +325,13 @@ BFstatus bfMemcpy(void* dst, #if defined BF_CUDA_ENABLED && BF_CUDA_ENABLED case BF_SPACE_CUDA_HOST: // fall-through #endif - case BF_SPACE_MAPPED: // fall-through + case BF_SPACE_MAPPED: // fall-through case BF_SPACE_SYSTEM: { switch( dst_space ) { #if defined BF_CUDA_ENABLED && BF_CUDA_ENABLED case BF_SPACE_CUDA_HOST: // fall-through #endif - case BF_SPACE_MAPPED: // fall-through + case BF_SPACE_MAPPED: // fall-through case BF_SPACE_SYSTEM: ::memcpy(dst, src, count); return BF_STATUS_SUCCESS; #if defined BF_CUDA_ENABLED && BF_CUDA_ENABLED case BF_SPACE_CUDA: kind = cudaMemcpyHostToDevice; break; @@ -345,7 +345,7 @@ BFstatus bfMemcpy(void* dst, case BF_SPACE_CUDA: { switch( dst_space ) { case BF_SPACE_CUDA_HOST: // fall-through - case BF_SPACE_MAPPED: // fall-through # TODO: Is this a good idea? + case BF_SPACE_MAPPED: // fall-through # TODO: Is this a good idea? case BF_SPACE_SYSTEM: kind = cudaMemcpyDeviceToHost; break; case BF_SPACE_CUDA: kind = cudaMemcpyDeviceToDevice; break; // TODO: BF_SPACE_CUDA_MANAGED @@ -401,13 +401,13 @@ BFstatus bfMemcpy2D(void* dst, #if defined BF_CUDA_ENABLED && BF_CUDA_ENABLED case BF_SPACE_CUDA_HOST: // fall-through #endif - case BF_SPACE_MAPPED: // fall-through + case BF_SPACE_MAPPED: // fall-through case BF_SPACE_SYSTEM: { switch( dst_space ) { #if defined BF_CUDA_ENABLED && BF_CUDA_ENABLED case BF_SPACE_CUDA_HOST: // fall-through #endif - case BF_SPACE_MAPPED: // fall-through + case BF_SPACE_MAPPED: // fall-through case BF_SPACE_SYSTEM: memcpy2D(dst, dst_stride, src, src_stride, width, height); return BF_STATUS_SUCCESS; #if defined BF_CUDA_ENABLED && BF_CUDA_ENABLED case BF_SPACE_CUDA: kind = cudaMemcpyHostToDevice; break; @@ -422,7 +422,7 @@ BFstatus bfMemcpy2D(void* dst, case BF_SPACE_CUDA: { switch( dst_space ) { case BF_SPACE_CUDA_HOST: // fall-through - case BF_SPACE_MAPPED: // fall-through # TODO: Is this a good idea? + case BF_SPACE_MAPPED: // fall-through # TODO: Is this a good idea? case BF_SPACE_SYSTEM: kind = cudaMemcpyDeviceToHost; break; case BF_SPACE_CUDA: kind = cudaMemcpyDeviceToDevice; break; // TODO: Is this the right thing to do? From 1d755d84b2f1da730a158d96f69ae4de856ddb2b Mon Sep 17 00:00:00 2001 From: jaycedowell Date: Wed, 18 Mar 2020 13:21:35 -0600 Subject: [PATCH 18/48] Formatting cleanup in memory.h. --- src/bifrost/memory.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bifrost/memory.h b/src/bifrost/memory.h index e8af7437d..bc1dcab54 100644 --- a/src/bifrost/memory.h +++ b/src/bifrost/memory.h @@ -47,7 +47,7 @@ extern "C" { typedef enum BFspace_ { BF_SPACE_AUTO = 0, BF_SPACE_SYSTEM = 1, // aligned_alloc - BF_SPACE_MAPPED = 2, // mmapped to a file + BF_SPACE_MAPPED = 2, // mmapped to a file BF_SPACE_CUDA = 3, // cudaMalloc BF_SPACE_CUDA_HOST = 4, // cudaHostAlloc BF_SPACE_CUDA_MANAGED = 5 // cudaMallocManaged From 497057a1612d93432b451dc9ddd75525759743b2 Mon Sep 17 00:00:00 2001 From: jaycedowell Date: Wed, 18 Mar 2020 13:50:10 -0600 Subject: [PATCH 19/48] Clean up some compiler warnings in memory.cpp a la PR #136. Updated src/Makefile to try to make the mapped path less fiddly. --- src/Makefile | 2 +- src/memory.cpp | 21 +++++++++++++++++---- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/Makefile b/src/Makefile index e333d1dce..afa625b86 100644 --- a/src/Makefile +++ b/src/Makefile @@ -101,7 +101,7 @@ ifdef ALIGNMENT endif ifdef MAPPED_RING_DIR - CPPFLAGS += -DBF_MAPPED_RING_DIR='"$(strip $(MAPPED_RING_DIR))"' + CPPFLAGS += -DBF_MAPPED_RING_DIR='"$(patsubst %/,%,$(MAPPED_RING_DIR))"' endif ifdef CUDA_DEBUG diff --git a/src/memory.cpp b/src/memory.cpp index 40c52558b..9e1a6cb63 100644 --- a/src/memory.cpp +++ b/src/memory.cpp @@ -125,7 +125,6 @@ class MappedMgr { strcat(tempname, "/mmapXXXXXX"); int fd = ::mkstemp(tempname); std::string filename = std::string(tempname); - //std::cout << "filename: " << filename << std::endl; if( fd < 0 ) { this->cleanup(filename, fd); return 1; @@ -145,7 +144,7 @@ class MappedMgr { return 3; } - // Advise the kernel of how we'll use it + // Advise the kernel of how we'll use it ::madvise(*data, size, MADV_SEQUENTIAL); // Save and return @@ -215,6 +214,19 @@ BFstatus bfGetSpace(const void* ptr, BFspace* space) { } // WAR to avoid the ignored failure showing up later cudaGetLastError(); +#if defined(CUDA_VERSION) && CUDA_VERSION >= 10000 + } else { + switch( ptr_attrs.type ) { + case cudaMemoryTypeHost: *space = BF_SPACE_SYSTEM; break; + case cudaMemoryTypeDevice: *space = BF_SPACE_CUDA; break; + case cudaMemoryTypeManaged: *space = BF_SPACE_CUDA_MANAGED; break; + default: { + // This should never be reached + BF_FAIL("Valid memoryType", BF_STATUS_INTERNAL_ERROR); + } + } + } +#else } else if( ptr_attrs.isManaged ) { *space = BF_SPACE_CUDA_MANAGED; } else { @@ -227,6 +239,7 @@ BFstatus bfGetSpace(const void* ptr, BFspace* space) { } } } +#endif // defined(CUDA_VERSION) && CUDA_VERSION >= 10000 #endif return BF_STATUS_SUCCESS; } @@ -387,7 +400,7 @@ BFstatus bfMemcpy2D(void* dst, BFspace src_space, BFsize width, // bytes BFsize height) { // rows - if( width*height ) { + if( width && height ) { BF_ASSERT(dst, BF_STATUS_INVALID_POINTER); BF_ASSERT(src, BF_STATUS_INVALID_POINTER); // Note: Explicitly dispatching to ::memcpy was found to be much faster @@ -489,7 +502,7 @@ BFstatus bfMemset2D(void* ptr, BFsize width, // bytes BFsize height) { // rows BF_ASSERT(ptr, BF_STATUS_INVALID_POINTER); - if( width*height ) { + if( width && height ) { if( space == BF_SPACE_AUTO ) { bfGetSpace(ptr, &space); } From 4ccffeb85c348012dfbad2780748a59487a3bce3 Mon Sep 17 00:00:00 2001 From: jaycedowell Date: Tue, 9 Jun 2020 16:41:54 -0600 Subject: [PATCH 20/48] Formatting cleanup. --- src/utils.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils.hpp b/src/utils.hpp index 7c8e28c95..162fdc0d0 100644 --- a/src/utils.hpp +++ b/src/utils.hpp @@ -210,7 +210,7 @@ byteswap(T value, T* result) { inline BFbool space_accessible_from(BFspace space, BFspace from) { #if !defined BF_CUDA_ENABLED || !BF_CUDA_ENABLED return ( (space == BF_SPACE_SYSTEM) - || (space == BF_SPACE_MAPPED) ); + || (space == BF_SPACE_MAPPED) ); #else switch( from ) { #if !defined BF_CUDA_ENABLED || !BF_CUDA_ENABLED @@ -218,7 +218,7 @@ inline BFbool space_accessible_from(BFspace space, BFspace from) { #endif case BF_SPACE_MAPPED: // fall-through case BF_SPACE_SYSTEM: return (space == BF_SPACE_SYSTEM || - space == BF_SPACE_MAPPED || + space == BF_SPACE_MAPPED || space == BF_SPACE_CUDA_HOST || space == BF_SPACE_CUDA_MANAGED); case BF_SPACE_CUDA: return (space == BF_SPACE_CUDA || From 9bbac381d8f61249c6dc96211499ef55218d16f4 Mon Sep 17 00:00:00 2001 From: jaycedowell Date: Thu, 11 Jun 2020 19:00:12 -0600 Subject: [PATCH 21/48] Updated memory.cpp so that the BIFROST_MAPPED_RING_DIR enviroment variable can be used to override the default mmap()'d ring location for a pipeline. --- src/memory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/memory.cpp b/src/memory.cpp index 9e1a6cb63..1cad826ff 100644 --- a/src/memory.cpp +++ b/src/memory.cpp @@ -56,7 +56,7 @@ static_assert(BF_IS_POW2(BF_ALIGNMENT), "BF_ALIGNMENT must be a power of 2"); #endif class MappedMgr { - static constexpr const char* base_mapped_dir = BF_MAPPED_RING_DIR; + static constexpr const char* base_mapped_dir = (std::getenv("BIFROST_MAPPED_RING_DIR") != NULL ? std::getenv("BIFROST_MAPPED_RING_DIR") : BF_MAPPED_RING_DIR); std::string _mapped_dir; std::map _filenames; std::map _fds; From 7d3aa57eeef759d7aa6fbcd3e80e68bacdcda458 Mon Sep 17 00:00:00 2001 From: jaycedowell Date: Thu, 11 Jun 2020 19:04:54 -0600 Subject: [PATCH 22/48] Oh yeah, it's not strictly static anymore. --- src/memory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/memory.cpp b/src/memory.cpp index 1cad826ff..f1f108cf0 100644 --- a/src/memory.cpp +++ b/src/memory.cpp @@ -56,7 +56,7 @@ static_assert(BF_IS_POW2(BF_ALIGNMENT), "BF_ALIGNMENT must be a power of 2"); #endif class MappedMgr { - static constexpr const char* base_mapped_dir = (std::getenv("BIFROST_MAPPED_RING_DIR") != NULL ? std::getenv("BIFROST_MAPPED_RING_DIR") : BF_MAPPED_RING_DIR); + const char* base_mapped_dir = (std::getenv("BIFROST_MAPPED_RING_DIR") != NULL ? std::getenv("BIFROST_MAPPED_RING_DIR") : BF_MAPPED_RING_DIR); std::string _mapped_dir; std::map _filenames; std::map _fds; From a489d0e219169af3eee57c8a021009aa48cab701 Mon Sep 17 00:00:00 2001 From: jaycedowell Date: Sun, 14 Jun 2020 15:19:15 -0600 Subject: [PATCH 23/48] Switched to a shorter environment variable name for runtime specification of where the mapped rings live. --- src/memory.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/memory.cpp b/src/memory.cpp index f1f108cf0..150c82192 100644 --- a/src/memory.cpp +++ b/src/memory.cpp @@ -56,7 +56,9 @@ static_assert(BF_IS_POW2(BF_ALIGNMENT), "BF_ALIGNMENT must be a power of 2"); #endif class MappedMgr { - const char* base_mapped_dir = (std::getenv("BIFROST_MAPPED_RING_DIR") != NULL ? std::getenv("BIFROST_MAPPED_RING_DIR") : BF_MAPPED_RING_DIR); + const char* base_mapped_dir = ((std::getenv("BIFROST_MMAP_DIR") != NULL) \ + ? std::getenv("BIFROST_MMAP_DIR") \ + : BF_MAPPED_RING_DIR); std::string _mapped_dir; std::map _filenames; std::map _fds; From b3338e9bd3b0dd31e0bf201657ed64ce79de220c Mon Sep 17 00:00:00 2001 From: jaycedowell Date: Mon, 15 Jun 2020 08:32:34 -0600 Subject: [PATCH 24/48] Another iteration of the environemnt variable name. Plus, a note to the user in user.mk about its existence. --- src/memory.cpp | 4 ++-- user.mk | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/memory.cpp b/src/memory.cpp index 150c82192..aed9966c7 100644 --- a/src/memory.cpp +++ b/src/memory.cpp @@ -56,8 +56,8 @@ static_assert(BF_IS_POW2(BF_ALIGNMENT), "BF_ALIGNMENT must be a power of 2"); #endif class MappedMgr { - const char* base_mapped_dir = ((std::getenv("BIFROST_MMAP_DIR") != NULL) \ - ? std::getenv("BIFROST_MMAP_DIR") \ + const char* base_mapped_dir = ((std::getenv("BIFROST_MAPPED_DIR") != NULL) \ + ? std::getenv("BIFROST_MAPPED_DIR") \ : BF_MAPPED_RING_DIR); std::string _mapped_dir; std::map _filenames; diff --git a/user.mk b/user.mk index c0f5e1fa9..b37a795d1 100644 --- a/user.mk +++ b/user.mk @@ -20,7 +20,10 @@ CUDA_INCDIR ?= $(CUDA_HOME)/include ALIGNMENT ?= 4096 # Memory allocation alignment -#MAPPED_RING_DIR ?= /tmp/bifrost # Mapped ring space file location +#MAPPED_RING_DIR ?= /tmp/bifrost # Mapped ring space file location + # NOTE: This location can also be overridden + # at runtime by setting the BIFROST_MAPPED_DIR + # environement variable #NODEBUG = 1 # Disable debugging mode (use this for production releases) #TRACE = 1 # Enable tracing mode (generates annotations for use with nvprof/nvvp) From 2567d9946bd1cb81e829f4b97838529706b3d338 Mon Sep 17 00:00:00 2001 From: jaycedowell Date: Tue, 22 Mar 2022 12:52:23 -0600 Subject: [PATCH 25/48] Rebuild configure. --- configure | 5832 +++++++++++------------------------------------------ 1 file changed, 1164 insertions(+), 4668 deletions(-) diff --git a/configure b/configure index 9b068b575..042ac0a6e 100755 --- a/configure +++ b/configure @@ -661,50 +661,9 @@ LTLIBOBJS PACKAGE_VERSION_MICRO PACKAGE_VERSION_MINOR PACKAGE_VERSION_MAJOR -DX_RULES -PAPER_SIZE -DOXYGEN_PAPER_SIZE -GENERATE_LATEX -DX_PDFLATEX -DX_FLAG_pdf -DX_EGREP -DX_DVIPS -DX_MAKEINDEX -DX_LATEX -DX_FLAG_ps -DX_FLAG_html -GENERATE_CHI -DX_FLAG_chi -GENERATE_HTMLHELP -GENERATE_HTML -HHC_PATH -DX_HHC -DX_FLAG_chm -GENERATE_XML -DX_FLAG_xml -GENERATE_RTF -DX_FLAG_rtf -GENERATE_MAN -DX_FLAG_man -DOT_PATH -HAVE_DOT -DX_DOT -DX_FLAG_dot -PERL_PATH -DX_PERL -DX_DOXYGEN -DX_FLAG_doc -PROJECT -SRCDIR -DX_ENV -DX_DOCDIR -DX_CONFIG -DX_PROJECT HAVE_DOCKER -DOCKER PYINSTALLFLAGS PYBUILDFLAGS -PYTHON HAVE_PYTHON HAVE_CUDA_DEBUG enable_native_arch @@ -730,10 +689,7 @@ HAVE_FLOAT128 HAVE_OPENMP LIBOBJS HAVE_RECVMSG -HAVE_CXX11 -HAVE_CXX14 SO_EXT -CTAGS SET_MAKE INSTALL_DATA INSTALL_SCRIPT @@ -832,7 +788,6 @@ with_aix_soname with_gnu_ld with_sysroot enable_libtool_lock -with_ctags enable_numa enable_hwloc enable_vma @@ -847,21 +802,10 @@ enable_debug enable_trace enable_native_arch enable_cuda_debug +with_mapped_ring_dir enable_python -with_python with_pybuild_flags with_pyinstall_flags -with_docker -enable_doxygen_doc -enable_doxygen_dot -enable_doxygen_man -enable_doxygen_rtf -enable_doxygen_xml -enable_doxygen_chm -enable_doxygen_chi -enable_doxygen_html -enable_doxygen_ps -enable_doxygen_pdf ' ac_precious_vars='build_alias host_alias @@ -875,11 +819,7 @@ CXX CXXFLAGS CCC LT_SYS_LIBRARY_PATH -CXXCPP -CTAGS -PYTHON -DOCKER -DOXYGEN_PAPER_SIZE' +CXXCPP' # Initialize some variables set by options. @@ -1516,17 +1456,6 @@ Optional Features: --disable-native-arch disable native architecture compilation (default=no) --enable-cuda-debug enable CUDA debugging (nvcc -G; default=no) --disable-python disable building the Python bindings (default=no) - --disable-doxygen-doc don't generate any doxygen documentation - --enable-doxygen-dot generate graphics for doxygen documentation - --disable-doxygen-man don't generate doxygen manual pages - --enable-doxygen-rtf generate doxygen RTF documentation - --enable-doxygen-xml generate doxygen XML documentation - --enable-doxygen-chm generate doxygen compressed HTML help documentation - --enable-doxygen-chi generate doxygen separate compressed HTML help index - file - --disable-doxygen-html don't generate doxygen plain HTML documentation - --disable-doxygen-ps don't generate doxygen PostScript documentation - --disable-doxygen-pdf don't generate doxygen PDF documentation Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -1539,7 +1468,6 @@ Optional Packages: --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified). - --with-ctags=[PATH] absolute path to ctags executable --with-cuda-home CUDA install path (default=/usr/local/cuda) --with-nvcc-flags flags to pass to NVCC (default='-O3 -Xcompiler "-Wall"') @@ -1548,10 +1476,11 @@ Optional Packages: --with-alignment=N default memory alignment in bytes (default=4096) --with-logging-dir=DIR directory for Bifrost proclog logging (default=autodetect) - --with-python=[PATH] absolute path to python executable + --with-mapped-ring-dir=... + directory to store mapped ring files in + (default=/tmp/bifrost) --with-pybuild-flags build flags for python (default='') --with-pyinstall-flags install flags for python (default='') - --with-docker=[PATH] absolute path to docker executable Some influential environment variables: CC C compiler command @@ -1566,11 +1495,6 @@ Some influential environment variables: LT_SYS_LIBRARY_PATH User-defined run-time library search path. CXXCPP C++ preprocessor - CTAGS Absolute path to ctags executable - PYTHON Absolute path to python executable - DOCKER Absolute path to docker executable - DOXYGEN_PAPER_SIZE - a4wide (default), a4, letter, legal or executive Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. @@ -17443,151 +17367,7 @@ printf "%s\n" "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi - - - - - - - - - - - if test -z "$CTAGS" -then : - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ctags executable path has been provided" >&5 -printf %s "checking whether ctags executable path has been provided... " >&6; } - -# Check whether --with-ctags was given. -if test ${with_ctags+y} -then : - withval=$with_ctags; - if test "$withval" != yes && test "$withval" != no -then : - - CTAGS="$withval" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CTAGS" >&5 -printf "%s\n" "$CTAGS" >&6; } - -else $as_nop - - CTAGS="" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - if test "$withval" != no -then : - - # Extract the first word of "ctags", so it can be a program name with args. -set dummy ctags; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_CTAGS+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $CTAGS in - [\\/]* | ?:[\\/]*) - ac_cv_path_CTAGS="$CTAGS" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_CTAGS="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -CTAGS=$ac_cv_path_CTAGS -if test -n "$CTAGS"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CTAGS" >&5 -printf "%s\n" "$CTAGS" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - -fi - -fi - -else $as_nop - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - # Extract the first word of "ctags", so it can be a program name with args. -set dummy ctags; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_CTAGS+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $CTAGS in - [\\/]* | ?:[\\/]*) - ac_cv_path_CTAGS="$CTAGS" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_CTAGS="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -CTAGS=$ac_cv_path_CTAGS -if test -n "$CTAGS"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CTAGS" >&5 -printf "%s\n" "$CTAGS" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - -fi - - -fi - - - - - - +AX_WITH_PROG(CTAGS, ctags) if test x${CTAGS} = x then : as_fn_error $? "Required program ctags was not found" "$LINENO" 5 @@ -17655,4749 +17435,1465 @@ _ACEOF ;; esac - ax_cxx_compile_alternatives="14 1y" ax_cxx_compile_cxx14_required=false - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - ac_success=no - +AX_CXX_COMPILE_STDCXX(14, noext, optional) +if test x$HAVE_CXX14 != x1 +then : + AX_CXX_COMPILE_STDCXX(11, noext, mandatory) +fi +ac_fn_cxx_check_func "$LINENO" "memset" "ac_cv_func_memset" +if test "x$ac_cv_func_memset" = xyes +then : + printf "%s\n" "#define HAVE_MEMSET 1" >>confdefs.h +fi +ac_fn_cxx_check_func "$LINENO" "rint" "ac_cv_func_rint" +if test "x$ac_cv_func_rint" = xyes +then : + printf "%s\n" "#define HAVE_RINT 1" >>confdefs.h +fi - if test x$ac_success = xno; then - for alternative in ${ax_cxx_compile_alternatives}; do - for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}"; do - cachevar=`printf "%s\n" "ax_cv_cxx_compile_cxx14_$switch" | $as_tr_sh` - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++14 features with $switch" >&5 -printf %s "checking whether $CXX supports C++14 features with $switch... " >&6; } -if eval test \${$cachevar+y} +ac_fn_cxx_check_func "$LINENO" "socket" "ac_cv_func_socket" +if test "x$ac_cv_func_socket" = xyes then : - printf %s "(cached) " >&6 -else $as_nop - ac_save_CXX="$CXX" - CXX="$CXX $switch" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + printf "%s\n" "#define HAVE_SOCKET 1" >>confdefs.h +fi -// If the compiler admits that it is not ready for C++11, why torture it? -// Hopefully, this will speed up the test. -#ifndef __cplusplus + for ac_func in recvmsg +do : + ac_fn_cxx_check_func "$LINENO" "recvmsg" "ac_cv_func_recvmsg" +if test "x$ac_cv_func_recvmsg" = xyes +then : + printf "%s\n" "#define HAVE_RECVMSG 1" >>confdefs.h + HAVE_RECVMSG=1 -#error "This is not a C++ compiler" +else $as_nop + HAVE_RECVMSG=0 -#elif __cplusplus < 201103L +fi -#error "This is not a C++11 compiler" +done +ac_fn_cxx_check_func "$LINENO" "sqrt" "ac_cv_func_sqrt" +if test "x$ac_cv_func_sqrt" = xyes +then : + printf "%s\n" "#define HAVE_SQRT 1" >>confdefs.h -#else +fi -namespace cxx11 -{ +ac_fn_cxx_check_func "$LINENO" "strerror" "ac_cv_func_strerror" +if test "x$ac_cv_func_strerror" = xyes +then : + printf "%s\n" "#define HAVE_STRERROR 1" >>confdefs.h - namespace test_static_assert - { +fi - template - struct check - { - static_assert(sizeof(int) <= sizeof(T), "not big enough"); - }; +ac_fn_cxx_check_header_compile "$LINENO" "arpa/inet.h" "ac_cv_header_arpa_inet_h" "$ac_includes_default" +if test "x$ac_cv_header_arpa_inet_h" = xyes +then : + printf "%s\n" "#define HAVE_ARPA_INET_H 1" >>confdefs.h - } +fi - namespace test_final_override - { +ac_fn_cxx_check_header_compile "$LINENO" "netdb.h" "ac_cv_header_netdb_h" "$ac_includes_default" +if test "x$ac_cv_header_netdb_h" = xyes +then : + printf "%s\n" "#define HAVE_NETDB_H 1" >>confdefs.h - struct Base - { - virtual ~Base() {} - virtual void f() {} - }; +fi - struct Derived : public Base - { - virtual ~Derived() override {} - virtual void f() override {} - }; +ac_fn_cxx_check_header_compile "$LINENO" "netinet/in.h" "ac_cv_header_netinet_in_h" "$ac_includes_default" +if test "x$ac_cv_header_netinet_in_h" = xyes +then : + printf "%s\n" "#define HAVE_NETINET_IN_H 1" >>confdefs.h - } +fi - namespace test_double_right_angle_brackets - { +ac_fn_cxx_check_header_compile "$LINENO" "sys/file.h" "ac_cv_header_sys_file_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_file_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_FILE_H 1" >>confdefs.h - template < typename T > - struct check {}; +fi - typedef check single_type; - typedef check> double_type; - typedef check>> triple_type; - typedef check>>> quadruple_type; +ac_fn_cxx_check_header_compile "$LINENO" "sys/ioctl.h" "ac_cv_header_sys_ioctl_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_ioctl_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_IOCTL_H 1" >>confdefs.h - } +fi - namespace test_decltype - { +ac_fn_cxx_check_header_compile "$LINENO" "sys/socket.h" "ac_cv_header_sys_socket_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_socket_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_SOCKET_H 1" >>confdefs.h - int - f() - { - int a = 1; - decltype(a) b = 2; - return a + b; - } +fi - } +ac_fn_cxx_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default" +if test "x$ac_cv_type__Bool" = xyes +then : - namespace test_type_deduction - { +printf "%s\n" "#define HAVE__BOOL 1" >>confdefs.h - template < typename T1, typename T2 > - struct is_same - { - static const bool value = false; - }; - template < typename T > - struct is_same - { - static const bool value = true; - }; +fi - template < typename T1, typename T2 > - auto - add(T1 a1, T2 a2) -> decltype(a1 + a2) - { - return a1 + a2; - } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5 +printf %s "checking for stdbool.h that conforms to C99... " >&6; } +if test ${ac_cv_header_stdbool_h+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include - int - test(const int c, volatile int v) - { - static_assert(is_same::value == true, ""); - static_assert(is_same::value == false, ""); - static_assert(is_same::value == false, ""); - auto ac = c; - auto av = v; - auto sumi = ac + av + 'x'; - auto sumf = ac + av + 1.0; - static_assert(is_same::value == true, ""); - static_assert(is_same::value == true, ""); - static_assert(is_same::value == true, ""); - static_assert(is_same::value == false, ""); - static_assert(is_same::value == true, ""); - return (sumf > 0.0) ? sumi : add(c, v); - } + #ifndef __bool_true_false_are_defined + #error "__bool_true_false_are_defined is not defined" + #endif + char a[__bool_true_false_are_defined == 1 ? 1 : -1]; - } + /* Regardless of whether this is C++ or "_Bool" is a + valid type name, "true" and "false" should be usable + in #if expressions and integer constant expressions, + and "bool" should be a valid type name. */ - namespace test_noexcept - { + #if !true + #error "'true' is not true" + #endif + #if true != 1 + #error "'true' is not equal to 1" + #endif + char b[true == 1 ? 1 : -1]; + char c[true]; - int f() { return 0; } - int g() noexcept { return 0; } + #if false + #error "'false' is not false" + #endif + #if false != 0 + #error "'false' is not equal to 0" + #endif + char d[false == 0 ? 1 : -1]; - static_assert(noexcept(f()) == false, ""); - static_assert(noexcept(g()) == true, ""); + enum { e = false, f = true, g = false * true, h = true * 256 }; - } + char i[(bool) 0.5 == true ? 1 : -1]; + char j[(bool) 0.0 == false ? 1 : -1]; + char k[sizeof (bool) > 0 ? 1 : -1]; - namespace test_constexpr - { - - template < typename CharT > - unsigned long constexpr - strlen_c_r(const CharT *const s, const unsigned long acc) noexcept - { - return *s ? strlen_c_r(s + 1, acc + 1) : acc; - } - - template < typename CharT > - unsigned long constexpr - strlen_c(const CharT *const s) noexcept - { - return strlen_c_r(s, 0UL); - } + struct sb { bool s: 1; bool t; } s; + char l[sizeof s.t > 0 ? 1 : -1]; - static_assert(strlen_c("") == 0UL, ""); - static_assert(strlen_c("1") == 1UL, ""); - static_assert(strlen_c("example") == 7UL, ""); - static_assert(strlen_c("another\0example") == 7UL, ""); + /* The following fails for + HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ + bool m[h]; + char n[sizeof m == h * sizeof m[0] ? 1 : -1]; + char o[-1 - (bool) 0 < 0 ? 1 : -1]; + /* Catch a bug in an HP-UX C compiler. See + https://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html + https://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html + */ + bool p = true; + bool *pp = &p; - } + /* C 1999 specifies that bool, true, and false are to be + macros, but C++ 2011 and later overrule this. */ + #if __cplusplus < 201103 + #ifndef bool + #error "bool is not defined" + #endif + #ifndef false + #error "false is not defined" + #endif + #ifndef true + #error "true is not defined" + #endif + #endif - namespace test_rvalue_references - { + /* If _Bool is available, repeat with it all the tests + above that used bool. */ + #ifdef HAVE__BOOL + struct sB { _Bool s: 1; _Bool t; } t; - template < int N > - struct answer - { - static constexpr int value = N; - }; + char q[(_Bool) 0.5 == true ? 1 : -1]; + char r[(_Bool) 0.0 == false ? 1 : -1]; + char u[sizeof (_Bool) > 0 ? 1 : -1]; + char v[sizeof t.t > 0 ? 1 : -1]; - answer<1> f(int&) { return answer<1>(); } - answer<2> f(const int&) { return answer<2>(); } - answer<3> f(int&&) { return answer<3>(); } + _Bool w[h]; + char x[sizeof m == h * sizeof m[0] ? 1 : -1]; + char y[-1 - (_Bool) 0 < 0 ? 1 : -1]; + _Bool z = true; + _Bool *pz = &p; + #endif - void - test() - { - int i = 0; - const int c = 0; - static_assert(decltype(f(i))::value == 1, ""); - static_assert(decltype(f(c))::value == 2, ""); - static_assert(decltype(f(0))::value == 3, ""); - } +int +main (void) +{ - } + bool ps = &s; + *pp |= p; + *pp |= ! p; - namespace test_uniform_initialization - { + #ifdef HAVE__BOOL + _Bool pt = &t; + *pz |= z; + *pz |= ! z; + #endif - struct test - { - static const int zero {}; - static const int one {1}; - }; + /* Refer to every declared value, so they cannot be + discarded as unused. */ + return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !j + !k + + !l + !m + !n + !o + !p + !pp + !ps + #ifdef HAVE__BOOL + + !q + !r + !u + !v + !w + !x + !y + !z + !pt + #endif + ); - static_assert(test::zero == 0, ""); - static_assert(test::one == 1, ""); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + ac_cv_header_stdbool_h=yes +else $as_nop + ac_cv_header_stdbool_h=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5 +printf "%s\n" "$ac_cv_header_stdbool_h" >&6; } - } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5 +printf %s "checking for GNU libc compatible malloc... " >&6; } +if test ${ac_cv_func_malloc_0_nonnull+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test "$cross_compiling" = yes +then : + case "$host_os" in # (( + # Guess yes on platforms where we know the result. + *-gnu* | freebsd* | netbsd* | openbsd* | bitrig* \ + | hpux* | solaris* | cygwin* | mingw* | msys* ) + ac_cv_func_malloc_0_nonnull=yes ;; + # If we don't know, assume the worst. + *) ac_cv_func_malloc_0_nonnull=no ;; + esac +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include - namespace test_lambdas - { +int +main (void) +{ +void *p = malloc (0); + int result = !p; + free (p); + return result; + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_run "$LINENO" +then : + ac_cv_func_malloc_0_nonnull=yes +else $as_nop + ac_cv_func_malloc_0_nonnull=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi - void - test1() - { - auto lambda1 = [](){}; - auto lambda2 = lambda1; - lambda1(); - lambda2(); - } +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5 +printf "%s\n" "$ac_cv_func_malloc_0_nonnull" >&6; } +if test $ac_cv_func_malloc_0_nonnull = yes +then : - int - test2() - { - auto a = [](int i, int j){ return i + j; }(1, 2); - auto b = []() -> int { return '0'; }(); - auto c = [=](){ return a + b; }(); - auto d = [&](){ return c; }(); - auto e = [a, &b](int x) mutable { - const auto identity = [](int y){ return y; }; - for (auto i = 0; i < a; ++i) - a += b--; - return x + identity(a + b); - }(0); - return a + b + c + d + e; - } +printf "%s\n" "#define HAVE_MALLOC 1" >>confdefs.h - int - test3() - { - const auto nullary = [](){ return 0; }; - const auto unary = [](int x){ return x; }; - using nullary_t = decltype(nullary); - using unary_t = decltype(unary); - const auto higher1st = [](nullary_t f){ return f(); }; - const auto higher2nd = [unary](nullary_t f1){ - return [unary, f1](unary_t f2){ return f2(unary(f1())); }; - }; - return higher1st(nullary) + higher2nd(nullary)(unary); - } +else $as_nop + printf "%s\n" "#define HAVE_MALLOC 0" >>confdefs.h - } + case " $LIBOBJS " in + *" malloc.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS malloc.$ac_objext" + ;; +esac - namespace test_variadic_templates - { - template - struct sum; +printf "%s\n" "#define malloc rpl_malloc" >>confdefs.h - template - struct sum - { - static constexpr auto value = N0 + sum::value; - }; +fi - template <> - struct sum<> - { - static constexpr auto value = 0; - }; - static_assert(sum<>::value == 0, ""); - static_assert(sum<1>::value == 1, ""); - static_assert(sum<23>::value == 23, ""); - static_assert(sum<1, 2>::value == 3, ""); - static_assert(sum<5, 5, 11>::value == 21, ""); - static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); - } +HAVE_OPENMP=0 - // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae - // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function - // because of this. - namespace test_template_alias_sfinae - { +AX_OPENMP +if test x$OPENMP_CXXFLAGS != x +then : + HAVE_OPENMP=1 - struct foo {}; +fi +if test x$HAVE_OPENMP != x1 +then : - template - using member = typename T::member_type; +else $as_nop + CXXFLAGS="$CXXFLAGS $OPENMP_CXXFLAGS" + LDFLAGS="$LDFLAGS $OPENMP_CXXFLAGS" +fi - template - void func(...) {} +ac_fn_cxx_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default" +if test "x$ac_cv_type_ptrdiff_t" = xyes +then : - template - void func(member*) {} +printf "%s\n" "#define HAVE_PTRDIFF_T 1" >>confdefs.h - void test(); - void test() { func(0); } +fi - } +ac_fn_c_find_intX_t "$LINENO" "16" "ac_cv_c_int16_t" +case $ac_cv_c_int16_t in #( + no|yes) ;; #( + *) -} // namespace cxx11 +printf "%s\n" "#define int16_t $ac_cv_c_int16_t" >>confdefs.h +;; +esac -#endif // __cplusplus >= 201103L +ac_fn_c_find_intX_t "$LINENO" "32" "ac_cv_c_int32_t" +case $ac_cv_c_int32_t in #( + no|yes) ;; #( + *) +printf "%s\n" "#define int32_t $ac_cv_c_int32_t" >>confdefs.h +;; +esac +ac_fn_c_find_intX_t "$LINENO" "64" "ac_cv_c_int64_t" +case $ac_cv_c_int64_t in #( + no|yes) ;; #( + *) +printf "%s\n" "#define int64_t $ac_cv_c_int64_t" >>confdefs.h +;; +esac -// If the compiler admits that it is not ready for C++14, why torture it? -// Hopefully, this will speed up the test. +ac_fn_c_find_intX_t "$LINENO" "8" "ac_cv_c_int8_t" +case $ac_cv_c_int8_t in #( + no|yes) ;; #( + *) -#ifndef __cplusplus +printf "%s\n" "#define int8_t $ac_cv_c_int8_t" >>confdefs.h +;; +esac -#error "This is not a C++ compiler" -#elif __cplusplus < 201402L + ac_fn_cxx_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default +" +if test "x$ac_cv_type_pid_t" = xyes +then : -#error "This is not a C++14 compiler" +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -#else + #if defined _WIN64 && !defined __CYGWIN__ + LLP64 + #endif -namespace cxx14 +int +main (void) { - namespace test_polymorphic_lambdas - { + ; + return 0; +} - int - test() - { - const auto lambda = [](auto&&... args){ - const auto istiny = [](auto x){ - return (sizeof(x) == 1UL) ? 1 : 0; - }; - const int aretiny[] = { istiny(args)... }; - return aretiny[0]; - }; - return lambda(1, 1L, 1.0f, '1'); - } +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + ac_pid_type='int' +else $as_nop + ac_pid_type='__int64' +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - } +printf "%s\n" "#define pid_t $ac_pid_type" >>confdefs.h - namespace test_binary_literals - { - constexpr auto ivii = 0b0000000000101010; - static_assert(ivii == 42, "wrong value"); +fi - } - namespace test_generalized_constexpr - { +ac_fn_cxx_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" +if test "x$ac_cv_type_size_t" = xyes +then : - template < typename CharT > - constexpr unsigned long - strlen_c(const CharT *const s) noexcept - { - auto length = 0UL; - for (auto p = s; *p; ++p) - ++length; - return length; - } +else $as_nop - static_assert(strlen_c("") == 0UL, ""); - static_assert(strlen_c("x") == 1UL, ""); - static_assert(strlen_c("test") == 4UL, ""); - static_assert(strlen_c("another\0test") == 7UL, ""); +printf "%s\n" "#define size_t unsigned int" >>confdefs.h - } +fi - namespace test_lambda_init_capture - { +ac_fn_cxx_check_type "$LINENO" "ssize_t" "ac_cv_type_ssize_t" "$ac_includes_default" +if test "x$ac_cv_type_ssize_t" = xyes +then : - int - test() - { - auto x = 0; - const auto lambda1 = [a = x](int b){ return a + b; }; - const auto lambda2 = [a = lambda1(x)](){ return a; }; - return lambda2(); - } +else $as_nop - } +printf "%s\n" "#define ssize_t int" >>confdefs.h - namespace test_digit_separators - { +fi - constexpr auto ten_million = 100'000'000; - static_assert(ten_million == 100000000, ""); +ac_fn_c_find_uintX_t "$LINENO" "16" "ac_cv_c_uint16_t" +case $ac_cv_c_uint16_t in #( + no|yes) ;; #( + *) - } - namespace test_return_type_deduction - { +printf "%s\n" "#define uint16_t $ac_cv_c_uint16_t" >>confdefs.h +;; + esac - auto f(int& x) { return x; } - decltype(auto) g(int& x) { return x; } +ac_fn_c_find_uintX_t "$LINENO" "32" "ac_cv_c_uint32_t" +case $ac_cv_c_uint32_t in #( + no|yes) ;; #( + *) - template < typename T1, typename T2 > - struct is_same - { - static constexpr auto value = false; - }; +printf "%s\n" "#define _UINT32_T 1" >>confdefs.h - template < typename T > - struct is_same - { - static constexpr auto value = true; - }; - int - test() - { - auto x = 0; - static_assert(is_same::value, ""); - static_assert(is_same::value, ""); - return x; - } +printf "%s\n" "#define uint32_t $ac_cv_c_uint32_t" >>confdefs.h +;; + esac - } +ac_fn_c_find_uintX_t "$LINENO" "64" "ac_cv_c_uint64_t" +case $ac_cv_c_uint64_t in #( + no|yes) ;; #( + *) + +printf "%s\n" "#define _UINT64_T 1" >>confdefs.h + + +printf "%s\n" "#define uint64_t $ac_cv_c_uint64_t" >>confdefs.h +;; + esac + +ac_fn_c_find_uintX_t "$LINENO" "8" "ac_cv_c_uint8_t" +case $ac_cv_c_uint8_t in #( + no|yes) ;; #( + *) + +printf "%s\n" "#define _UINT8_T 1" >>confdefs.h -} // namespace cxx14 -#endif // __cplusplus >= 201402L +printf "%s\n" "#define uint8_t $ac_cv_c_uint8_t" >>confdefs.h +;; + esac + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for long double with more range or precision than double" >&5 +printf %s "checking for long double with more range or precision than double... " >&6; } +if test ${ac_cv_type_long_double_wider+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + long double const a[] = + { + 0.0L, DBL_MIN, DBL_MAX, DBL_EPSILON, + LDBL_MIN, LDBL_MAX, LDBL_EPSILON + }; + long double + f (long double x) + { + return ((x + (unsigned long int) 10) * (-1 / x) + a[0] + + (x ? f (x) : 'c')); + } +int +main (void) +{ +static int test_array [1 - 2 * !((0 < ((DBL_MAX_EXP < LDBL_MAX_EXP) + + (DBL_MANT_DIG < LDBL_MANT_DIG) + - (LDBL_MAX_EXP < DBL_MAX_EXP) + - (LDBL_MANT_DIG < DBL_MANT_DIG))) + && (int) LDBL_EPSILON == 0 + )]; +test_array [0] = 0; +return test_array [0]; + ; + return 0; +} _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : - eval $cachevar=yes + ac_cv_type_long_double_wider=yes else $as_nop - eval $cachevar=no + ac_cv_type_long_double_wider=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - CXX="$ac_save_CXX" fi -eval ac_res=\$$cachevar - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } - if eval test x\$$cachevar = xyes; then - CXX="$CXX $switch" - if test -n "$CXXCPP" ; then - CXXCPP="$CXXCPP $switch" - fi - ac_success=yes - break - fi - done - if test x$ac_success = xyes; then - break - fi - done - fi - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - if test x$ax_cxx_compile_cxx14_required = xtrue; then - if test x$ac_success = xno; then - as_fn_error $? "*** A compiler with support for C++14 language features is required." "$LINENO" 5 - fi - fi - if test x$ac_success = xno; then - HAVE_CXX14=0 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: No compiler with C++14 support was found" >&5 -printf "%s\n" "$as_me: No compiler with C++14 support was found" >&6;} - else - HAVE_CXX14=1 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_double_wider" >&5 +printf "%s\n" "$ac_cv_type_long_double_wider" >&6; } + if test $ac_cv_type_long_double_wider = yes; then -printf "%s\n" "#define HAVE_CXX14 1" >>confdefs.h +printf "%s\n" "#define HAVE_LONG_DOUBLE_WIDER 1" >>confdefs.h fi +HAVE_FLOAT128=0 -if test x$HAVE_CXX14 != x1 +if test x$HAVE_HAVE_LONG_DOUBLE_WIDER = x1 then : - ax_cxx_compile_alternatives="11 0x" ax_cxx_compile_cxx11_required=true - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - ac_success=no + HAVE_FLOAT128=0 +fi +# +# NUMA +# +# Check whether --enable-numa was given. +if test ${enable_numa+y} +then : + enableval=$enable_numa; enable_numa=no +else $as_nop + enable_numa=yes +fi +HAVE_NUMA=0 - if test x$ac_success = xno; then - for alternative in ${ax_cxx_compile_alternatives}; do - for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}"; do - cachevar=`printf "%s\n" "ax_cv_cxx_compile_cxx11_$switch" | $as_tr_sh` - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features with $switch" >&5 -printf %s "checking whether $CXX supports C++11 features with $switch... " >&6; } -if eval test \${$cachevar+y} +if test x$enable_numa != xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for numa_node_of_cpu in -lnuma" >&5 +printf %s "checking for numa_node_of_cpu in -lnuma... " >&6; } +if test ${ac_cv_lib_numa_numa_node_of_cpu+y} then : printf %s "(cached) " >&6 else $as_nop - ac_save_CXX="$CXX" - CXX="$CXX $switch" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + ac_check_lib_save_LIBS=$LIBS +LIBS="-lnuma $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - -// If the compiler admits that it is not ready for C++11, why torture it? -// Hopefully, this will speed up the test. - -#ifndef __cplusplus - -#error "This is not a C++ compiler" - -#elif __cplusplus < 201103L - -#error "This is not a C++11 compiler" - -#else - -namespace cxx11 +namespace conftest { + extern "C" int numa_node_of_cpu (); +} +int +main (void) { +return conftest::numa_node_of_cpu (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO" +then : + ac_cv_lib_numa_numa_node_of_cpu=yes +else $as_nop + ac_cv_lib_numa_numa_node_of_cpu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_numa_numa_node_of_cpu" >&5 +printf "%s\n" "$ac_cv_lib_numa_numa_node_of_cpu" >&6; } +if test "x$ac_cv_lib_numa_numa_node_of_cpu" = xyes +then : + HAVE_NUMA=1 - namespace test_static_assert - { + LIBS="$LIBS -lnuma" +fi - template - struct check - { - static_assert(sizeof(int) <= sizeof(T), "not big enough"); - }; +fi - } +# +# HWLOC +# - namespace test_final_override - { +# Check whether --enable-hwloc was given. +if test ${enable_hwloc+y} +then : + enableval=$enable_hwloc; enable_hwloc=no +else $as_nop + enable_hwloc=yes +fi - struct Base - { - virtual ~Base() {} - virtual void f() {} - }; +HAVE_HWLOC=0 - struct Derived : public Base - { - virtual ~Derived() override {} - virtual void f() override {} - }; +if test x$enable_hwloc != xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for hwloc_topology_init in -lhwloc" >&5 +printf %s "checking for hwloc_topology_init in -lhwloc... " >&6; } +if test ${ac_cv_lib_hwloc_hwloc_topology_init+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lhwloc $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - } +namespace conftest { + extern "C" int hwloc_topology_init (); +} +int +main (void) +{ +return conftest::hwloc_topology_init (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO" +then : + ac_cv_lib_hwloc_hwloc_topology_init=yes +else $as_nop + ac_cv_lib_hwloc_hwloc_topology_init=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hwloc_hwloc_topology_init" >&5 +printf "%s\n" "$ac_cv_lib_hwloc_hwloc_topology_init" >&6; } +if test "x$ac_cv_lib_hwloc_hwloc_topology_init" = xyes +then : + HAVE_HWLOC=1 - namespace test_double_right_angle_brackets - { + LIBS="$LIBS -lhwloc" +fi - template < typename T > - struct check {}; +fi - typedef check single_type; - typedef check> double_type; - typedef check>> triple_type; - typedef check>>> quadruple_type; +# +# VMA +# - } +# Check whether --enable-vma was given. +if test ${enable_vma+y} +then : + enableval=$enable_vma; enable_vma=yes +else $as_nop + enable_vma=no +fi - namespace test_decltype - { +HAVE_VMA=0 - int - f() - { - int a = 1; - decltype(a) b = 2; - return a + b; - } +if test x$enable_vma != xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for recvfrom_zcopy in -lvma" >&5 +printf %s "checking for recvfrom_zcopy in -lvma... " >&6; } +if test ${ac_cv_lib_vma_recvfrom_zcopy+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lvma $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - } +namespace conftest { + extern "C" int recvfrom_zcopy (); +} +int +main (void) +{ +return conftest::recvfrom_zcopy (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO" +then : + ac_cv_lib_vma_recvfrom_zcopy=yes +else $as_nop + ac_cv_lib_vma_recvfrom_zcopy=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_vma_recvfrom_zcopy" >&5 +printf "%s\n" "$ac_cv_lib_vma_recvfrom_zcopy" >&6; } +if test "x$ac_cv_lib_vma_recvfrom_zcopy" = xyes +then : + HAVE_VMA=1 - namespace test_type_deduction - { + LIBS="$LIBS -lvma" +fi - template < typename T1, typename T2 > - struct is_same - { - static const bool value = false; - }; +fi - template < typename T > - struct is_same - { - static const bool value = true; - }; +# +# CUDA +# - template < typename T1, typename T2 > - auto - add(T1 a1, T2 a2) -> decltype(a1 + a2) - { - return a1 + a2; - } +################################# +# NOTE # +# This needs to come after all # +# other compiler/library tests # +# since it changes LIB to # +# include CUDA-specific entries # +################################# - int - test(const int c, volatile int v) - { - static_assert(is_same::value == true, ""); - static_assert(is_same::value == false, ""); - static_assert(is_same::value == false, ""); - auto ac = c; - auto av = v; - auto sumi = ac + av + 'x'; - auto sumf = ac + av + 1.0; - static_assert(is_same::value == true, ""); - static_assert(is_same::value == true, ""); - static_assert(is_same::value == true, ""); - static_assert(is_same::value == false, ""); - static_assert(is_same::value == true, ""); - return (sumf > 0.0) ? sumi : add(c, v); - } - } - namespace test_noexcept - { - int f() { return 0; } - int g() noexcept { return 0; } +# Check whether --with-cuda_home was given. +if test ${with_cuda_home+y} +then : + withval=$with_cuda_home; +else $as_nop + with_cuda_home=/usr/local/cuda +fi - static_assert(noexcept(f()) == false, ""); - static_assert(noexcept(g()) == true, ""); + CUDA_HOME=$with_cuda_home - } - namespace test_constexpr - { + # Check whether --enable-cuda was given. +if test ${enable_cuda+y} +then : + enableval=$enable_cuda; enable_cuda=no +else $as_nop + enable_cuda=yes +fi - template < typename CharT > - unsigned long constexpr - strlen_c_r(const CharT *const s, const unsigned long acc) noexcept - { - return *s ? strlen_c_r(s + 1, acc + 1) : acc; - } - template < typename CharT > - unsigned long constexpr - strlen_c(const CharT *const s) noexcept - { - return strlen_c_r(s, 0UL); - } + HAVE_CUDA=0 - static_assert(strlen_c("") == 0UL, ""); - static_assert(strlen_c("1") == 1UL, ""); - static_assert(strlen_c("example") == 7UL, ""); - static_assert(strlen_c("another\0example") == 7UL, ""); + CUDA_VERSION=0 - } + GPU_MAX_ARCH=0 - namespace test_rvalue_references - { + if test "$enable_cuda" != "no"; then + HAVE_CUDA=1 - template < int N > - struct answer - { - static constexpr int value = N; - }; - answer<1> f(int&) { return answer<1>(); } - answer<2> f(const int&) { return answer<2>(); } - answer<3> f(int&&) { return answer<3>(); } + # Extract the first word of "nvcc", so it can be a program name with args. +set dummy nvcc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_NVCC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $NVCC in + [\\/]* | ?:[\\/]*) + ac_cv_path_NVCC="$NVCC" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$CUDA_HOME/bin:$PATH" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_NVCC="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS - void - test() - { - int i = 0; - const int c = 0; - static_assert(decltype(f(i))::value == 1, ""); - static_assert(decltype(f(c))::value == 2, ""); - static_assert(decltype(f(0))::value == 3, ""); - } + test -z "$ac_cv_path_NVCC" && ac_cv_path_NVCC="no" + ;; +esac +fi +NVCC=$ac_cv_path_NVCC +if test -n "$NVCC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $NVCC" >&5 +printf "%s\n" "$NVCC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi - } - namespace test_uniform_initialization - { + # Extract the first word of "nvprune", so it can be a program name with args. +set dummy nvprune; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_NVPRUNE+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $NVPRUNE in + [\\/]* | ?:[\\/]*) + ac_cv_path_NVPRUNE="$NVPRUNE" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$CUDA_HOME/bin:$PATH" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_NVPRUNE="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS - struct test - { - static const int zero {}; - static const int one {1}; - }; + test -z "$ac_cv_path_NVPRUNE" && ac_cv_path_NVPRUNE="no" + ;; +esac +fi +NVPRUNE=$ac_cv_path_NVPRUNE +if test -n "$NVPRUNE"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $NVPRUNE" >&5 +printf "%s\n" "$NVPRUNE" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi - static_assert(test::zero == 0, ""); - static_assert(test::one == 1, ""); - } + # Extract the first word of "cuobjdump", so it can be a program name with args. +set dummy cuobjdump; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_CUOBJDUMP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $CUOBJDUMP in + [\\/]* | ?:[\\/]*) + ac_cv_path_CUOBJDUMP="$CUOBJDUMP" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$CUDA_HOME/bin:$PATH" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_CUOBJDUMP="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS - namespace test_lambdas - { + test -z "$ac_cv_path_CUOBJDUMP" && ac_cv_path_CUOBJDUMP="no" + ;; +esac +fi +CUOBJDUMP=$ac_cv_path_CUOBJDUMP +if test -n "$CUOBJDUMP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CUOBJDUMP" >&5 +printf "%s\n" "$CUOBJDUMP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi - void - test1() - { - auto lambda1 = [](){}; - auto lambda2 = lambda1; - lambda1(); - lambda2(); - } - int - test2() - { - auto a = [](int i, int j){ return i + j; }(1, 2); - auto b = []() -> int { return '0'; }(); - auto c = [=](){ return a + b; }(); - auto d = [&](){ return c; }(); - auto e = [a, &b](int x) mutable { - const auto identity = [](int y){ return y; }; - for (auto i = 0; i < a; ++i) - a += b--; - return x + identity(a + b); - }(0); - return a + b + c + d + e; - } + fi - int - test3() - { - const auto nullary = [](){ return 0; }; - const auto unary = [](int x){ return x; }; - using nullary_t = decltype(nullary); - using unary_t = decltype(unary); - const auto higher1st = [](nullary_t f){ return f(); }; - const auto higher2nd = [unary](nullary_t f1){ - return [unary, f1](unary_t f2){ return f2(unary(f1())); }; - }; - return higher1st(nullary) + higher2nd(nullary)(unary); - } + if test "$HAVE_CUDA" = "1"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a working CUDA installation" >&5 +printf %s "checking for a working CUDA installation... " >&6; } - } + CXXFLAGS_save="$CXXFLAGS" + LDFLAGS_save="$LDFLAGS" + LIBS_save="$LIBS" - namespace test_variadic_templates - { + ac_compile='$NVCC -c $NVCCFLAGS conftest.$ac_ext >&5' + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - template - struct sum; - template - struct sum - { - static constexpr auto value = N0 + sum::value; - }; + #include + #include +int +main (void) +{ +cudaMalloc(0, 0); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : - template <> - struct sum<> - { - static constexpr auto value = 0; - }; +else $as_nop + HAVE_CUDA=0 - static_assert(sum<>::value == 0, ""); - static_assert(sum<1>::value == 1, ""); - static_assert(sum<23>::value == 23, ""); - static_assert(sum<1, 2>::value == 3, ""); - static_assert(sum<5, 5, 11>::value == 21, ""); - static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - } + if test "$HAVE_CUDA" = "1"; then + LDFLAGS="-L$CUDA_HOME/lib64 -L$CUDA_HOME/lib" + LIBS="$LIBS -lcuda -lcudart" - // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae - // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function - // because of this. - namespace test_template_alias_sfinae - { - - struct foo {}; - - template - using member = typename T::member_type; - - template - void func(...) {} - - template - void func(member*) {} - - void test(); + ac_link='$NVCC -o conftest$ac_exeext $NVCCFLAGS $LDFLAGS $LIBS conftest.$ac_ext >&5' + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - void test() { func(0); } - } + #include + #include +int +main (void) +{ +cudaMalloc(0, 0); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO" +then : + CUDA_VERSION=$( ${NVCC} --version | ${GREP} -Po -e "release.*," | cut -d, -f1 | cut -d\ -f2 ) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes - v$CUDA_VERSION" >&5 +printf "%s\n" "yes - v$CUDA_VERSION" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + HAVE_CUDA=0 -} // namespace cxx11 +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + HAVE_CUDA=0 -#endif // __cplusplus >= 201103L + fi + CXXFLAGS="$CXXFLAGS_save" + LDFLAGS="$LDFLAGS_save" + LIBS="$LIBS_save" + fi -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" +# Check whether --with-nvcc_flags was given. +if test ${with_nvcc_flags+y} then : - eval $cachevar=yes + withval=$with_nvcc_flags; else $as_nop - eval $cachevar=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - CXX="$ac_save_CXX" + with_nvcc_flags='-O3 -Xcompiler "-Wall"' fi -eval ac_res=\$$cachevar - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } - if eval test x\$$cachevar = xyes; then - CXX="$CXX $switch" - if test -n "$CXXCPP" ; then - CXXCPP="$CXXCPP $switch" - fi - ac_success=yes - break - fi - done - if test x$ac_success = xyes; then - break - fi - done - fi - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - if test x$ax_cxx_compile_cxx11_required = xtrue; then - if test x$ac_success = xno; then - as_fn_error $? "*** A compiler with support for C++11 language features is required." "$LINENO" 5 - fi - fi - if test x$ac_success = xno; then - HAVE_CXX11=0 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: No compiler with C++11 support was found" >&5 -printf "%s\n" "$as_me: No compiler with C++11 support was found" >&6;} - else - HAVE_CXX11=1 + NVCCFLAGS=$with_nvcc_flags -printf "%s\n" "#define HAVE_CXX11 1" >>confdefs.h + if test "$HAVE_CUDA" = "1"; then + CPPFLAGS="$CPPFLAGS -DBF_CUDA_ENABLED=1" + CXXFLAGS="$CXXFLAGS -DBF_CUDA_ENABLED=1" + NVCCFLAGS="$NVCCFLAGS -DBF_CUDA_ENABLED=1" + LDFLAGS="$LDFLAGS -L$CUDA_HOME/lib64 -L$CUDA_HOME/lib" + LIBS="$LIBS -lcuda -lcudart -lnvrtc -lcublas -lcudadevrt -L. -lcufft_static_pruned -lculibos -lnvToolsExt" fi -fi -ac_fn_cxx_check_func "$LINENO" "memset" "ac_cv_func_memset" -if test "x$ac_cv_func_memset" = xyes +# Check whether --with-gpu_archs was given. +if test ${with_gpu_archs+y} then : - printf "%s\n" "#define HAVE_MEMSET 1" >>confdefs.h - + withval=$with_gpu_archs; +else $as_nop + with_gpu_archs='auto' fi -ac_fn_cxx_check_func "$LINENO" "rint" "ac_cv_func_rint" -if test "x$ac_cv_func_rint" = xyes -then : - printf "%s\n" "#define HAVE_RINT 1" >>confdefs.h + if test "$HAVE_CUDA" = "1"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for valid CUDA architectures" >&5 +printf %s "checking for valid CUDA architectures... " >&6; } + ar_supported=$( ${NVCC} -h | ${GREP} -Po "'compute_[0-9]{2,3}" | cut -d_ -f2 | sort | uniq ) + ar_supported_flat=$( echo $ar_supported | xargs ) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: found: $ar_supported_flat" >&5 +printf "%s\n" "found: $ar_supported_flat" >&6; } -fi + if test "$with_gpu_archs" = "auto"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking which CUDA architectures to target" >&5 +printf %s "checking which CUDA architectures to target... " >&6; } -ac_fn_cxx_check_func "$LINENO" "socket" "ac_cv_func_socket" -if test "x$ac_cv_func_socket" = xyes + CXXFLAGS_save="$CXXFLAGS" + LDFLAGS_save="$LDFLAGS" + LIBS_save="$LIBS" + + LDFLAGS="-L$CUDA_HOME/lib64 -L$CUDA_HOME/lib" + LIBS="-lcuda -lcudart" + ac_run='$NVCC -o conftest$ac_ext $LDFLAGS $LIBS conftest.$ac_ext>&5' + if test "$cross_compiling" = yes then : - printf "%s\n" "#define HAVE_SOCKET 1" >>confdefs.h + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -fi + #include + #include + #include + #include + #include +int +main (void) +{ - for ac_func in recvmsg -do : - ac_fn_cxx_check_func "$LINENO" "recvmsg" "ac_cv_func_recvmsg" -if test "x$ac_cv_func_recvmsg" = xyes + std::set archs; + int major, minor, arch; + int deviceCount = 0; + cudaGetDeviceCount(&deviceCount); + if( deviceCount == 0 ) { + return 1; + } + std::ofstream fh; + fh.open("confarchs.out"); + for(int dev=0; dev 0 ) { + fh << " "; + } + fh << arch; + } + arch += minor; + if( archs.count(arch) == 0 ) { + archs.insert(arch); + fh << " " << arch; + } + } + fh.close(); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_run "$LINENO" then : - printf "%s\n" "#define HAVE_RECVMSG 1" >>confdefs.h - HAVE_RECVMSG=1 + GPU_ARCHS=`cat confarchs.out` -else $as_nop - HAVE_RECVMSG=0 + ar_supported=$( ${NVCC} -h | ${GREP} -Po "'compute_[0-9]{2,3}" | cut -d_ -f2 | sort | uniq ) + ar_valid=$( echo $GPU_ARCHS $ar_supported | xargs -n1 | sort | uniq -d | xargs ) + if test "$ar_valid" = ""; then + as_fn_error $? "failed to find any supported" "$LINENO" 5 + else + GPU_ARCHS=$ar_valid + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $GPU_ARCHS" >&5 +printf "%s\n" "$GPU_ARCHS" >&6; } + fi +else $as_nop + as_fn_error $? "failed to find any" "$LINENO" 5 fi - -done -ac_fn_cxx_check_func "$LINENO" "sqrt" "ac_cv_func_sqrt" -if test "x$ac_cv_func_sqrt" = xyes -then : - printf "%s\n" "#define HAVE_SQRT 1" >>confdefs.h - +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi -ac_fn_cxx_check_func "$LINENO" "strerror" "ac_cv_func_strerror" -if test "x$ac_cv_func_strerror" = xyes -then : - printf "%s\n" "#define HAVE_STRERROR 1" >>confdefs.h - -fi -ac_fn_cxx_check_header_compile "$LINENO" "arpa/inet.h" "ac_cv_header_arpa_inet_h" "$ac_includes_default" -if test "x$ac_cv_header_arpa_inet_h" = xyes -then : - printf "%s\n" "#define HAVE_ARPA_INET_H 1" >>confdefs.h + CXXFLAGS="$CXXFLAGS_save" + LDFLAGS="$LDFLAGS_save" + LIBS="$LIBS_save" + else + GPU_ARCHS=$with_gpu_archs -fi + fi -ac_fn_cxx_check_header_compile "$LINENO" "netdb.h" "ac_cv_header_netdb_h" "$ac_includes_default" -if test "x$ac_cv_header_netdb_h" = xyes -then : - printf "%s\n" "#define HAVE_NETDB_H 1" >>confdefs.h + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for valid requested CUDA architectures" >&5 +printf %s "checking for valid requested CUDA architectures... " >&6; } + ar_requested=$( echo "$GPU_ARCHS" | wc -w ) + ar_valid=$( echo $GPU_ARCHS $ar_supported | xargs -n1 | sort | uniq -d | xargs ) + ar_found=$( echo $ar_valid | wc -w ) + if test "$ar_requested" = "$ar_found"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + else + as_fn_error $? "only '$ar_valid' are supported" "$LINENO" 5 + fi -fi + ar_max_valid=$(echo $ar_valid | ${SED} -e 's/.* //g;' ) + GPU_MAX_ARCH=$ar_max_valid -ac_fn_cxx_check_header_compile "$LINENO" "netinet/in.h" "ac_cv_header_netinet_in_h" "$ac_includes_default" -if test "x$ac_cv_header_netinet_in_h" = xyes -then : - printf "%s\n" "#define HAVE_NETINET_IN_H 1" >>confdefs.h -fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Pascal-style CUDA managed memory" >&5 +printf %s "checking for Pascal-style CUDA managed memory... " >&6; } + cm_invalid=$( echo $GPU_ARCHS | ${SED} -e 's/\b[1-5][0-9]\b/PRE/g;' ) + if ! echo $cm_invalid | ${GREP} -q PRE; then + GPU_PASCAL_MANAGEDMEM=1 -ac_fn_cxx_check_header_compile "$LINENO" "sys/file.h" "ac_cv_header_sys_file_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_file_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_FILE_H 1" >>confdefs.h + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + else + GPU_PASCAL_MANAGEDMEM=0 -fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + fi + else + GPU_PASCAL_MANAGEDMEM=0 -ac_fn_cxx_check_header_compile "$LINENO" "sys/ioctl.h" "ac_cv_header_sys_ioctl_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_ioctl_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_IOCTL_H 1" >>confdefs.h + fi -fi -ac_fn_cxx_check_header_compile "$LINENO" "sys/socket.h" "ac_cv_header_sys_socket_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_socket_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_SOCKET_H 1" >>confdefs.h +# Check whether --with-shared_mem was given. +if test ${with_shared_mem+y} +then : + withval=$with_shared_mem; +else $as_nop + with_shared_mem=16384 fi -ac_fn_cxx_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default" -if test "x$ac_cv_type__Bool" = xyes -then : - -printf "%s\n" "#define HAVE__BOOL 1" >>confdefs.h - - -fi - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5 -printf %s "checking for stdbool.h that conforms to C99... " >&6; } -if test ${ac_cv_header_stdbool_h+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - - #ifndef __bool_true_false_are_defined - #error "__bool_true_false_are_defined is not defined" - #endif - char a[__bool_true_false_are_defined == 1 ? 1 : -1]; - - /* Regardless of whether this is C++ or "_Bool" is a - valid type name, "true" and "false" should be usable - in #if expressions and integer constant expressions, - and "bool" should be a valid type name. */ - - #if !true - #error "'true' is not true" - #endif - #if true != 1 - #error "'true' is not equal to 1" - #endif - char b[true == 1 ? 1 : -1]; - char c[true]; - - #if false - #error "'false' is not false" - #endif - #if false != 0 - #error "'false' is not equal to 0" - #endif - char d[false == 0 ? 1 : -1]; - - enum { e = false, f = true, g = false * true, h = true * 256 }; - - char i[(bool) 0.5 == true ? 1 : -1]; - char j[(bool) 0.0 == false ? 1 : -1]; - char k[sizeof (bool) > 0 ? 1 : -1]; - - struct sb { bool s: 1; bool t; } s; - char l[sizeof s.t > 0 ? 1 : -1]; - - /* The following fails for - HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ - bool m[h]; - char n[sizeof m == h * sizeof m[0] ? 1 : -1]; - char o[-1 - (bool) 0 < 0 ? 1 : -1]; - /* Catch a bug in an HP-UX C compiler. See - https://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html - https://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html - */ - bool p = true; - bool *pp = &p; - - /* C 1999 specifies that bool, true, and false are to be - macros, but C++ 2011 and later overrule this. */ - #if __cplusplus < 201103 - #ifndef bool - #error "bool is not defined" - #endif - #ifndef false - #error "false is not defined" - #endif - #ifndef true - #error "true is not defined" - #endif - #endif - - /* If _Bool is available, repeat with it all the tests - above that used bool. */ - #ifdef HAVE__BOOL - struct sB { _Bool s: 1; _Bool t; } t; - - char q[(_Bool) 0.5 == true ? 1 : -1]; - char r[(_Bool) 0.0 == false ? 1 : -1]; - char u[sizeof (_Bool) > 0 ? 1 : -1]; - char v[sizeof t.t > 0 ? 1 : -1]; - - _Bool w[h]; - char x[sizeof m == h * sizeof m[0] ? 1 : -1]; - char y[-1 - (_Bool) 0 < 0 ? 1 : -1]; - _Bool z = true; - _Bool *pz = &p; - #endif - -int -main (void) -{ - - bool ps = &s; - *pp |= p; - *pp |= ! p; - - #ifdef HAVE__BOOL - _Bool pt = &t; - *pz |= z; - *pz |= ! z; - #endif - - /* Refer to every declared value, so they cannot be - discarded as unused. */ - return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !j + !k - + !l + !m + !n + !o + !p + !pp + !ps - #ifdef HAVE__BOOL - + !q + !r + !u + !v + !w + !x + !y + !z + !pt - #endif - ); - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : - ac_cv_header_stdbool_h=yes -else $as_nop - ac_cv_header_stdbool_h=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5 -printf "%s\n" "$ac_cv_header_stdbool_h" >&6; } - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5 -printf %s "checking for GNU libc compatible malloc... " >&6; } -if test ${ac_cv_func_malloc_0_nonnull+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test "$cross_compiling" = yes -then : - case "$host_os" in # (( - # Guess yes on platforms where we know the result. - *-gnu* | freebsd* | netbsd* | openbsd* | bitrig* \ - | hpux* | solaris* | cygwin* | mingw* | msys* ) - ac_cv_func_malloc_0_nonnull=yes ;; - # If we don't know, assume the worst. - *) ac_cv_func_malloc_0_nonnull=no ;; - esac -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -int -main (void) -{ -void *p = malloc (0); - int result = !p; - free (p); - return result; - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_run "$LINENO" -then : - ac_cv_func_malloc_0_nonnull=yes -else $as_nop - ac_cv_func_malloc_0_nonnull=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5 -printf "%s\n" "$ac_cv_func_malloc_0_nonnull" >&6; } -if test $ac_cv_func_malloc_0_nonnull = yes -then : - -printf "%s\n" "#define HAVE_MALLOC 1" >>confdefs.h - -else $as_nop - printf "%s\n" "#define HAVE_MALLOC 0" >>confdefs.h - - case " $LIBOBJS " in - *" malloc.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS malloc.$ac_objext" - ;; -esac - - -printf "%s\n" "#define malloc rpl_malloc" >>confdefs.h - -fi - - - -HAVE_OPENMP=0 - - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for OpenMP flag of C++ compiler" >&5 -printf %s "checking for OpenMP flag of C++ compiler... " >&6; } -if test ${ax_cv_cxx_openmp+y} -then : - printf %s "(cached) " >&6 -else $as_nop - saveCXXFLAGS=$CXXFLAGS -ax_cv_cxx_openmp=unknown -# Flags to try: -fopenmp (gcc), -mp (SGI & PGI), -# -qopenmp (icc>=15), -openmp (icc), -# -xopenmp (Sun), -omp (Tru64), -# -qsmp=omp (AIX), -# none -ax_openmp_flags="-fopenmp -openmp -qopenmp -mp -xopenmp -omp -qsmp=omp none" -if test "x$OPENMP_CXXFLAGS" != x; then - ax_openmp_flags="$OPENMP_CXXFLAGS $ax_openmp_flags" -fi -for ax_openmp_flag in $ax_openmp_flags; do - case $ax_openmp_flag in - none) CXXFLAGS=$saveCXX ;; - *) CXXFLAGS="$saveCXXFLAGS $ax_openmp_flag" ;; - esac - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include - -static void -parallel_fill(int * data, int n) -{ - int i; -#pragma omp parallel for - for (i = 0; i < n; ++i) - data[i] = i; -} - -int -main() -{ - int arr[100000]; - omp_set_num_threads(2); - parallel_fill(arr, 100000); - return 0; -} - -_ACEOF -if ac_fn_cxx_try_link "$LINENO" -then : - ax_cv_cxx_openmp=$ax_openmp_flag; break -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -done -CXXFLAGS=$saveCXXFLAGS - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cxx_openmp" >&5 -printf "%s\n" "$ax_cv_cxx_openmp" >&6; } -if test "x$ax_cv_cxx_openmp" = "xunknown"; then - : -else - if test "x$ax_cv_cxx_openmp" != "xnone"; then - OPENMP_CXXFLAGS=$ax_cv_cxx_openmp - fi - -printf "%s\n" "#define HAVE_OPENMP 1" >>confdefs.h - -fi - -if test x$OPENMP_CXXFLAGS != x -then : - HAVE_OPENMP=1 - -fi -if test x$HAVE_OPENMP != x1 -then : - -else $as_nop - CXXFLAGS="$CXXFLAGS $OPENMP_CXXFLAGS" - LDFLAGS="$LDFLAGS $OPENMP_CXXFLAGS" -fi - -ac_fn_cxx_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default" -if test "x$ac_cv_type_ptrdiff_t" = xyes -then : - -printf "%s\n" "#define HAVE_PTRDIFF_T 1" >>confdefs.h - - -fi - -ac_fn_c_find_intX_t "$LINENO" "16" "ac_cv_c_int16_t" -case $ac_cv_c_int16_t in #( - no|yes) ;; #( - *) - -printf "%s\n" "#define int16_t $ac_cv_c_int16_t" >>confdefs.h -;; -esac - -ac_fn_c_find_intX_t "$LINENO" "32" "ac_cv_c_int32_t" -case $ac_cv_c_int32_t in #( - no|yes) ;; #( - *) - -printf "%s\n" "#define int32_t $ac_cv_c_int32_t" >>confdefs.h -;; -esac - -ac_fn_c_find_intX_t "$LINENO" "64" "ac_cv_c_int64_t" -case $ac_cv_c_int64_t in #( - no|yes) ;; #( - *) - -printf "%s\n" "#define int64_t $ac_cv_c_int64_t" >>confdefs.h -;; -esac - -ac_fn_c_find_intX_t "$LINENO" "8" "ac_cv_c_int8_t" -case $ac_cv_c_int8_t in #( - no|yes) ;; #( - *) - -printf "%s\n" "#define int8_t $ac_cv_c_int8_t" >>confdefs.h -;; -esac - - - ac_fn_cxx_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default -" -if test "x$ac_cv_type_pid_t" = xyes -then : - -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - #if defined _WIN64 && !defined __CYGWIN__ - LLP64 - #endif - -int -main (void) -{ - - ; - return 0; -} - -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : - ac_pid_type='int' -else $as_nop - ac_pid_type='__int64' -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - -printf "%s\n" "#define pid_t $ac_pid_type" >>confdefs.h - - -fi - - -ac_fn_cxx_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" -if test "x$ac_cv_type_size_t" = xyes -then : - -else $as_nop - -printf "%s\n" "#define size_t unsigned int" >>confdefs.h - -fi - -ac_fn_cxx_check_type "$LINENO" "ssize_t" "ac_cv_type_ssize_t" "$ac_includes_default" -if test "x$ac_cv_type_ssize_t" = xyes -then : - -else $as_nop - -printf "%s\n" "#define ssize_t int" >>confdefs.h - -fi - -ac_fn_c_find_uintX_t "$LINENO" "16" "ac_cv_c_uint16_t" -case $ac_cv_c_uint16_t in #( - no|yes) ;; #( - *) - - -printf "%s\n" "#define uint16_t $ac_cv_c_uint16_t" >>confdefs.h -;; - esac - -ac_fn_c_find_uintX_t "$LINENO" "32" "ac_cv_c_uint32_t" -case $ac_cv_c_uint32_t in #( - no|yes) ;; #( - *) - -printf "%s\n" "#define _UINT32_T 1" >>confdefs.h - - -printf "%s\n" "#define uint32_t $ac_cv_c_uint32_t" >>confdefs.h -;; - esac - -ac_fn_c_find_uintX_t "$LINENO" "64" "ac_cv_c_uint64_t" -case $ac_cv_c_uint64_t in #( - no|yes) ;; #( - *) - -printf "%s\n" "#define _UINT64_T 1" >>confdefs.h - - -printf "%s\n" "#define uint64_t $ac_cv_c_uint64_t" >>confdefs.h -;; - esac - -ac_fn_c_find_uintX_t "$LINENO" "8" "ac_cv_c_uint8_t" -case $ac_cv_c_uint8_t in #( - no|yes) ;; #( - *) - -printf "%s\n" "#define _UINT8_T 1" >>confdefs.h - - -printf "%s\n" "#define uint8_t $ac_cv_c_uint8_t" >>confdefs.h -;; - esac - - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for long double with more range or precision than double" >&5 -printf %s "checking for long double with more range or precision than double... " >&6; } -if test ${ac_cv_type_long_double_wider+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - long double const a[] = - { - 0.0L, DBL_MIN, DBL_MAX, DBL_EPSILON, - LDBL_MIN, LDBL_MAX, LDBL_EPSILON - }; - long double - f (long double x) - { - return ((x + (unsigned long int) 10) * (-1 / x) + a[0] - + (x ? f (x) : 'c')); - } - -int -main (void) -{ -static int test_array [1 - 2 * !((0 < ((DBL_MAX_EXP < LDBL_MAX_EXP) - + (DBL_MANT_DIG < LDBL_MANT_DIG) - - (LDBL_MAX_EXP < DBL_MAX_EXP) - - (LDBL_MANT_DIG < DBL_MANT_DIG))) - && (int) LDBL_EPSILON == 0 - )]; -test_array [0] = 0; -return test_array [0]; - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : - ac_cv_type_long_double_wider=yes -else $as_nop - ac_cv_type_long_double_wider=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_double_wider" >&5 -printf "%s\n" "$ac_cv_type_long_double_wider" >&6; } - if test $ac_cv_type_long_double_wider = yes; then - -printf "%s\n" "#define HAVE_LONG_DOUBLE_WIDER 1" >>confdefs.h - - fi - -HAVE_FLOAT128=0 - -if test x$HAVE_HAVE_LONG_DOUBLE_WIDER = x1 -then : - HAVE_FLOAT128=0 - -fi - -# -# NUMA -# - -# Check whether --enable-numa was given. -if test ${enable_numa+y} -then : - enableval=$enable_numa; enable_numa=no -else $as_nop - enable_numa=yes -fi - -HAVE_NUMA=0 - -if test x$enable_numa != xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for numa_node_of_cpu in -lnuma" >&5 -printf %s "checking for numa_node_of_cpu in -lnuma... " >&6; } -if test ${ac_cv_lib_numa_numa_node_of_cpu+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-lnuma $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -namespace conftest { - extern "C" int numa_node_of_cpu (); -} -int -main (void) -{ -return conftest::numa_node_of_cpu (); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO" -then : - ac_cv_lib_numa_numa_node_of_cpu=yes -else $as_nop - ac_cv_lib_numa_numa_node_of_cpu=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_numa_numa_node_of_cpu" >&5 -printf "%s\n" "$ac_cv_lib_numa_numa_node_of_cpu" >&6; } -if test "x$ac_cv_lib_numa_numa_node_of_cpu" = xyes -then : - HAVE_NUMA=1 - - LIBS="$LIBS -lnuma" -fi - -fi - -# -# HWLOC -# - -# Check whether --enable-hwloc was given. -if test ${enable_hwloc+y} -then : - enableval=$enable_hwloc; enable_hwloc=no -else $as_nop - enable_hwloc=yes -fi - -HAVE_HWLOC=0 - -if test x$enable_hwloc != xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for hwloc_topology_init in -lhwloc" >&5 -printf %s "checking for hwloc_topology_init in -lhwloc... " >&6; } -if test ${ac_cv_lib_hwloc_hwloc_topology_init+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-lhwloc $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -namespace conftest { - extern "C" int hwloc_topology_init (); -} -int -main (void) -{ -return conftest::hwloc_topology_init (); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO" -then : - ac_cv_lib_hwloc_hwloc_topology_init=yes -else $as_nop - ac_cv_lib_hwloc_hwloc_topology_init=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hwloc_hwloc_topology_init" >&5 -printf "%s\n" "$ac_cv_lib_hwloc_hwloc_topology_init" >&6; } -if test "x$ac_cv_lib_hwloc_hwloc_topology_init" = xyes -then : - HAVE_HWLOC=1 - - LIBS="$LIBS -lhwloc" -fi - -fi - -# -# VMA -# - -# Check whether --enable-vma was given. -if test ${enable_vma+y} -then : - enableval=$enable_vma; enable_vma=yes -else $as_nop - enable_vma=no -fi - -HAVE_VMA=0 - -if test x$enable_vma != xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for recvfrom_zcopy in -lvma" >&5 -printf %s "checking for recvfrom_zcopy in -lvma... " >&6; } -if test ${ac_cv_lib_vma_recvfrom_zcopy+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-lvma $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -namespace conftest { - extern "C" int recvfrom_zcopy (); -} -int -main (void) -{ -return conftest::recvfrom_zcopy (); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO" -then : - ac_cv_lib_vma_recvfrom_zcopy=yes -else $as_nop - ac_cv_lib_vma_recvfrom_zcopy=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_vma_recvfrom_zcopy" >&5 -printf "%s\n" "$ac_cv_lib_vma_recvfrom_zcopy" >&6; } -if test "x$ac_cv_lib_vma_recvfrom_zcopy" = xyes -then : - HAVE_VMA=1 - - LIBS="$LIBS -lvma" -fi - -fi - -# -# CUDA -# - -################################# -# NOTE # -# This needs to come after all # -# other compiler/library tests # -# since it changes LIB to # -# include CUDA-specific entries # -################################# - - - - -# Check whether --with-cuda_home was given. -if test ${with_cuda_home+y} -then : - withval=$with_cuda_home; -else $as_nop - with_cuda_home=/usr/local/cuda -fi - - CUDA_HOME=$with_cuda_home - - - # Check whether --enable-cuda was given. -if test ${enable_cuda+y} -then : - enableval=$enable_cuda; enable_cuda=no -else $as_nop - enable_cuda=yes -fi - - - HAVE_CUDA=0 - - CUDA_VERSION=0 - - GPU_MAX_ARCH=0 - - if test "$enable_cuda" != "no"; then - HAVE_CUDA=1 - - - # Extract the first word of "nvcc", so it can be a program name with args. -set dummy nvcc; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_NVCC+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $NVCC in - [\\/]* | ?:[\\/]*) - ac_cv_path_NVCC="$NVCC" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -as_dummy="$CUDA_HOME/bin:$PATH" -for as_dir in $as_dummy -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_NVCC="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - test -z "$ac_cv_path_NVCC" && ac_cv_path_NVCC="no" - ;; -esac -fi -NVCC=$ac_cv_path_NVCC -if test -n "$NVCC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $NVCC" >&5 -printf "%s\n" "$NVCC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - # Extract the first word of "nvprune", so it can be a program name with args. -set dummy nvprune; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_NVPRUNE+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $NVPRUNE in - [\\/]* | ?:[\\/]*) - ac_cv_path_NVPRUNE="$NVPRUNE" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -as_dummy="$CUDA_HOME/bin:$PATH" -for as_dir in $as_dummy -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_NVPRUNE="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - test -z "$ac_cv_path_NVPRUNE" && ac_cv_path_NVPRUNE="no" - ;; -esac -fi -NVPRUNE=$ac_cv_path_NVPRUNE -if test -n "$NVPRUNE"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $NVPRUNE" >&5 -printf "%s\n" "$NVPRUNE" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - # Extract the first word of "cuobjdump", so it can be a program name with args. -set dummy cuobjdump; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_CUOBJDUMP+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $CUOBJDUMP in - [\\/]* | ?:[\\/]*) - ac_cv_path_CUOBJDUMP="$CUOBJDUMP" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -as_dummy="$CUDA_HOME/bin:$PATH" -for as_dir in $as_dummy -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_CUOBJDUMP="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - test -z "$ac_cv_path_CUOBJDUMP" && ac_cv_path_CUOBJDUMP="no" - ;; -esac -fi -CUOBJDUMP=$ac_cv_path_CUOBJDUMP -if test -n "$CUOBJDUMP"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CUOBJDUMP" >&5 -printf "%s\n" "$CUOBJDUMP" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - fi - - if test "$HAVE_CUDA" = "1"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a working CUDA installation" >&5 -printf %s "checking for a working CUDA installation... " >&6; } - - CXXFLAGS_save="$CXXFLAGS" - LDFLAGS_save="$LDFLAGS" - LIBS_save="$LIBS" - - ac_compile='$NVCC -c $NVCCFLAGS conftest.$ac_ext >&5' - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - - #include - #include -int -main (void) -{ -cudaMalloc(0, 0); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : - -else $as_nop - HAVE_CUDA=0 - -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - - if test "$HAVE_CUDA" = "1"; then - LDFLAGS="-L$CUDA_HOME/lib64 -L$CUDA_HOME/lib" - LIBS="$LIBS -lcuda -lcudart" - - ac_link='$NVCC -o conftest$ac_exeext $NVCCFLAGS $LDFLAGS $LIBS conftest.$ac_ext >&5' - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - - #include - #include -int -main (void) -{ -cudaMalloc(0, 0); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO" -then : - CUDA_VERSION=$( ${NVCC} --version | ${GREP} -Po -e "release.*," | cut -d, -f1 | cut -d\ -f2 ) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes - v$CUDA_VERSION" >&5 -printf "%s\n" "yes - v$CUDA_VERSION" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - HAVE_CUDA=0 - -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - HAVE_CUDA=0 - - fi - - CXXFLAGS="$CXXFLAGS_save" - LDFLAGS="$LDFLAGS_save" - LIBS="$LIBS_save" - fi - - -# Check whether --with-nvcc_flags was given. -if test ${with_nvcc_flags+y} -then : - withval=$with_nvcc_flags; -else $as_nop - with_nvcc_flags='-O3 -Xcompiler "-Wall"' -fi - - NVCCFLAGS=$with_nvcc_flags - - - if test "$HAVE_CUDA" = "1"; then - CPPFLAGS="$CPPFLAGS -DBF_CUDA_ENABLED=1" - CXXFLAGS="$CXXFLAGS -DBF_CUDA_ENABLED=1" - NVCCFLAGS="$NVCCFLAGS -DBF_CUDA_ENABLED=1" - LDFLAGS="$LDFLAGS -L$CUDA_HOME/lib64 -L$CUDA_HOME/lib" - LIBS="$LIBS -lcuda -lcudart -lnvrtc -lcublas -lcudadevrt -L. -lcufft_static_pruned -lculibos -lnvToolsExt" - fi - - -# Check whether --with-gpu_archs was given. -if test ${with_gpu_archs+y} -then : - withval=$with_gpu_archs; -else $as_nop - with_gpu_archs='auto' -fi - - if test "$HAVE_CUDA" = "1"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for valid CUDA architectures" >&5 -printf %s "checking for valid CUDA architectures... " >&6; } - ar_supported=$( ${NVCC} -h | ${GREP} -Po "'compute_[0-9]{2,3}" | cut -d_ -f2 | sort | uniq ) - ar_supported_flat=$( echo $ar_supported | xargs ) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: found: $ar_supported_flat" >&5 -printf "%s\n" "found: $ar_supported_flat" >&6; } - - if test "$with_gpu_archs" = "auto"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking which CUDA architectures to target" >&5 -printf %s "checking which CUDA architectures to target... " >&6; } - - CXXFLAGS_save="$CXXFLAGS" - LDFLAGS_save="$LDFLAGS" - LIBS_save="$LIBS" - - LDFLAGS="-L$CUDA_HOME/lib64 -L$CUDA_HOME/lib" - LIBS="-lcuda -lcudart" - ac_run='$NVCC -o conftest$ac_ext $LDFLAGS $LIBS conftest.$ac_ext>&5' - if test "$cross_compiling" = yes -then : - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run test program while cross compiling -See \`config.log' for more details" "$LINENO" 5; } -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - - #include - #include - #include - #include - #include -int -main (void) -{ - - std::set archs; - int major, minor, arch; - int deviceCount = 0; - cudaGetDeviceCount(&deviceCount); - if( deviceCount == 0 ) { - return 1; - } - std::ofstream fh; - fh.open("confarchs.out"); - for(int dev=0; dev 0 ) { - fh << " "; - } - fh << arch; - } - arch += minor; - if( archs.count(arch) == 0 ) { - archs.insert(arch); - fh << " " << arch; - } - } - fh.close(); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_run "$LINENO" -then : - GPU_ARCHS=`cat confarchs.out` - - ar_supported=$( ${NVCC} -h | ${GREP} -Po "'compute_[0-9]{2,3}" | cut -d_ -f2 | sort | uniq ) - ar_valid=$( echo $GPU_ARCHS $ar_supported | xargs -n1 | sort | uniq -d | xargs ) - if test "$ar_valid" = ""; then - as_fn_error $? "failed to find any supported" "$LINENO" 5 - else - GPU_ARCHS=$ar_valid - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $GPU_ARCHS" >&5 -printf "%s\n" "$GPU_ARCHS" >&6; } - fi -else $as_nop - as_fn_error $? "failed to find any" "$LINENO" 5 -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - - - CXXFLAGS="$CXXFLAGS_save" - LDFLAGS="$LDFLAGS_save" - LIBS="$LIBS_save" - else - GPU_ARCHS=$with_gpu_archs - - fi - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for valid requested CUDA architectures" >&5 -printf %s "checking for valid requested CUDA architectures... " >&6; } - ar_requested=$( echo "$GPU_ARCHS" | wc -w ) - ar_valid=$( echo $GPU_ARCHS $ar_supported | xargs -n1 | sort | uniq -d | xargs ) - ar_found=$( echo $ar_valid | wc -w ) - if test "$ar_requested" = "$ar_found"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } - else - as_fn_error $? "only '$ar_valid' are supported" "$LINENO" 5 - fi - - ar_max_valid=$(echo $ar_valid | ${SED} -e 's/.* //g;' ) - GPU_MAX_ARCH=$ar_max_valid - - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Pascal-style CUDA managed memory" >&5 -printf %s "checking for Pascal-style CUDA managed memory... " >&6; } - cm_invalid=$( echo $GPU_ARCHS | ${SED} -e 's/\b[1-5][0-9]\b/PRE/g;' ) - if ! echo $cm_invalid | ${GREP} -q PRE; then - GPU_PASCAL_MANAGEDMEM=1 - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } - else - GPU_PASCAL_MANAGEDMEM=0 - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - fi - else - GPU_PASCAL_MANAGEDMEM=0 - - fi - - - -# Check whether --with-shared_mem was given. -if test ${with_shared_mem+y} -then : - withval=$with_shared_mem; -else $as_nop - with_shared_mem=16384 -fi - -GPU_SHAREDMEM=$with_shared_mem - -if test x$HAVE_CUDA = x0 -then : - GPU_SHAREDMEM=0 - -fi - -# -# Bifrost memory alignment -# - - -# Check whether --with-alignment was given. -if test ${with_alignment+y} -then : - withval=$with_alignment; -else $as_nop - with_alignment=4096 -fi - -ALIGNMENT=$with_alignment - - -# -# Bifrost proclog location -# - - - - - -# Check whether --with-logging_dir was given. -if test ${with_logging_dir+y} -then : - withval=$with_logging_dir; HAVE_TMPFS=$with_logging_dir - -else $as_nop - HAVE_TMPFS=/tmp - -fi - - - if test "$HAVE_TMPFS" = "/tmp"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for /dev/shm" >&5 -printf %s "checking for /dev/shm... " >&6; } -if test ${ac_cv_file__dev_shm+y} -then : - printf %s "(cached) " >&6 -else $as_nop - test "$cross_compiling" = yes && - as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 -if test -r "/dev/shm"; then - ac_cv_file__dev_shm=yes -else - ac_cv_file__dev_shm=no -fi -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__dev_shm" >&5 -printf "%s\n" "$ac_cv_file__dev_shm" >&6; } -if test "x$ac_cv_file__dev_shm" = xyes -then : - HAVE_TMPFS=/dev/shm/bifrost - -fi - - fi - - if test "$HAVE_TMPFS" = "/tmp"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for /Volumes/RAMDisk" >&5 -printf %s "checking for /Volumes/RAMDisk... " >&6; } -if test ${ac_cv_file__Volumes_RAMDisk+y} -then : - printf %s "(cached) " >&6 -else $as_nop - test "$cross_compiling" = yes && - as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 -if test -r "/Volumes/RAMDisk"; then - ac_cv_file__Volumes_RAMDisk=yes -else - ac_cv_file__Volumes_RAMDisk=no -fi -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__Volumes_RAMDisk" >&5 -printf "%s\n" "$ac_cv_file__Volumes_RAMDisk" >&6; } -if test "x$ac_cv_file__Volumes_RAMDisk" = xyes -then : - HAVE_TMPFS=/Volumes/RAMDisk/bifrost - -fi - - fi - - if test "$HAVE_TMPFS" = "/tmp"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for /tmp" >&5 -printf %s "checking for /tmp... " >&6; } -if test ${ac_cv_file__tmp+y} -then : - printf %s "(cached) " >&6 -else $as_nop - test "$cross_compiling" = yes && - as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 -if test -r "/tmp"; then - ac_cv_file__tmp=yes -else - ac_cv_file__tmp=no -fi -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__tmp" >&5 -printf "%s\n" "$ac_cv_file__tmp" >&6; } -if test "x$ac_cv_file__tmp" = xyes -then : - HAVE_TMPFS=/tmp - -fi - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $HAVE_TMPFS may have performance problems for logging" >&5 -printf "%s\n" "$as_me: WARNING: $HAVE_TMPFS may have performance problems for logging" >&2;} - HAVE_TMPFS=/tmp/bifrost - - fi - - -# -# Bifrost Features -# - -# Check whether --enable-debug was given. -if test ${enable_debug+y} -then : - enableval=$enable_debug; enable_debug=yes -else $as_nop - enable_debug=no -fi - -HAVE_DEBUG=0 - -if test x$enable_debug != xno -then : - HAVE_DEBUG=1 - - CXXFLAGS="$CXXFLAGS -g" - NVCCFLAGS="$NVCCFLAGS -g" -fi - -# Check whether --enable-trace was given. -if test ${enable_trace+y} -then : - enableval=$enable_trace; enable_trace=yes -else $as_nop - enable_trace=no -fi - -HAVE_TRACE=0 - -if test x$enable_trace != xno -then : - HAVE_TRACE=1 - -fi - - - - # Check whether --enable-native_arch was given. -if test ${enable_native_arch+y} -then : - enableval=$enable_native_arch; enable_native_arch=no -else $as_nop - enable_native_arch=yes -fi - - - if test "$enable_native_arch" = "yes"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the compiler accepts '-march=native'" >&5 -printf %s "checking if the compiler accepts '-march=native'... " >&6; } - - CXXFLAGS_temp="$CXXFLAGS -march=native" - - ac_compile='$CXX -c $CXXFLAGS_temp conftest.$ac_ext >&5' - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - - -int -main (void) -{ - - int i = 5; - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : - CXXFLAGS="$CXXFLAGS -march=native" - NVCCFLAGS="$NVCCFLAGS -Xcompiler \"-march=native\"" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } -else $as_nop - enable_native_arch=no - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - fi - - -# Check whether --enable-cuda_debug was given. -if test ${enable_cuda_debug+y} -then : - enableval=$enable_cuda_debug; enable_cuda_debug=yes -else $as_nop - enable_cuda_debug=no -fi - -HAVE_CUDA_DEBUG=0 - -if test x$enable_cuda_debug != xno -then : - HAVE_CUDA_DEBUG=1 - - NVCCFLAGS="$NVCCFLAGS -G" -fi - -# -# Python -# - -# Check whether --enable-python was given. -if test ${enable_python+y} -then : - enableval=$enable_python; enable_python=no -else $as_nop - enable_python=yes -fi - -HAVE_PYTHON=0 - -if test x$enable_python != xno -then : - - - - - - - - - - - if test -z "$PYTHON" -then : - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether python executable path has been provided" >&5 -printf %s "checking whether python executable path has been provided... " >&6; } - -# Check whether --with-python was given. -if test ${with_python+y} -then : - withval=$with_python; - if test "$withval" != yes && test "$withval" != no -then : - - PYTHON="$withval" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5 -printf "%s\n" "$PYTHON" >&6; } - -else $as_nop - - PYTHON="" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - if test "$withval" != no -then : - - # Extract the first word of "python", so it can be a program name with args. -set dummy python; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_PYTHON+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $PYTHON in - [\\/]* | ?:[\\/]*) - ac_cv_path_PYTHON="$PYTHON" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_PYTHON="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - test -z "$ac_cv_path_PYTHON" && ac_cv_path_PYTHON="no" - ;; -esac -fi -PYTHON=$ac_cv_path_PYTHON -if test -n "$PYTHON"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5 -printf "%s\n" "$PYTHON" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - -fi - -fi - -else $as_nop - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - # Extract the first word of "python", so it can be a program name with args. -set dummy python; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_PYTHON+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $PYTHON in - [\\/]* | ?:[\\/]*) - ac_cv_path_PYTHON="$PYTHON" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_PYTHON="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - test -z "$ac_cv_path_PYTHON" && ac_cv_path_PYTHON="no" - ;; -esac -fi -PYTHON=$ac_cv_path_PYTHON -if test -n "$PYTHON"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5 -printf "%s\n" "$PYTHON" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - -fi - - -fi - - - - - - - if test x${PYTHON} != xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $PYTHON as ctypesgen" >&5 -printf %s "checking whether $PYTHON as ctypesgen... " >&6; } - if ! ${PYTHON} -c "import ctypesgen" 2>/dev/null -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: python module will not be built" >&5 -printf "%s\n" "$as_me: WARNING: python module will not be built" >&2;} -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } - HAVE_PYTHON=1 - -fi -fi -fi - -# Check whether --with-pybuild_flags was given. -if test ${with_pybuild_flags+y} -then : - withval=$with_pybuild_flags; -fi - -PYBUILDFLAGS=$with_pybuild_flags - - - -# Check whether --with-pyinstall_flags was given. -if test ${with_pyinstall_flags+y} -then : - withval=$with_pyinstall_flags; -fi - -PYINSTALLFLAGS=$with_pyinstall_flags - - -# -# Docker -# - - - - - - - - - - - - if test -z "$DOCKER" -then : - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether docker executable path has been provided" >&5 -printf %s "checking whether docker executable path has been provided... " >&6; } - -# Check whether --with-docker was given. -if test ${with_docker+y} -then : - withval=$with_docker; - if test "$withval" != yes && test "$withval" != no -then : - - DOCKER="$withval" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DOCKER" >&5 -printf "%s\n" "$DOCKER" >&6; } - -else $as_nop - - DOCKER="" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - if test "$withval" != no -then : - - # Extract the first word of "docker", so it can be a program name with args. -set dummy docker; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_DOCKER+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $DOCKER in - [\\/]* | ?:[\\/]*) - ac_cv_path_DOCKER="$DOCKER" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_DOCKER="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - test -z "$ac_cv_path_DOCKER" && ac_cv_path_DOCKER="no" - ;; -esac -fi -DOCKER=$ac_cv_path_DOCKER -if test -n "$DOCKER"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DOCKER" >&5 -printf "%s\n" "$DOCKER" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - -fi - -fi - -else $as_nop - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - # Extract the first word of "docker", so it can be a program name with args. -set dummy docker; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_DOCKER+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $DOCKER in - [\\/]* | ?:[\\/]*) - ac_cv_path_DOCKER="$DOCKER" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_DOCKER="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - test -z "$ac_cv_path_DOCKER" && ac_cv_path_DOCKER="no" - ;; -esac -fi -DOCKER=$ac_cv_path_DOCKER -if test -n "$DOCKER"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DOCKER" >&5 -printf "%s\n" "$DOCKER" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - -fi - - -fi - - - - - - -if test x${DOCKER} != xno -then : - HAVE_DOCKER=1 - -fi - -# -# Documentation -# - - - - - - - - - - - - -# Files: -DX_PROJECT=bifrost - -DX_CONFIG='$(srcdir)/Doxyfile' - -DX_DOCDIR='doxygen-doc' - - -# Environment variables used inside doxygen.cfg: -DX_ENV="$DX_ENV SRCDIR='$srcdir'" -SRCDIR=$srcdir - -DX_ENV="$DX_ENV PROJECT='$DX_PROJECT'" -PROJECT=$DX_PROJECT - -DX_ENV="$DX_ENV VERSION='$PACKAGE_VERSION'" - - -# Doxygen itself: - - - - # Check whether --enable-doxygen-doc was given. -if test ${enable_doxygen_doc+y} -then : - enableval=$enable_doxygen_doc; -case "$enableval" in -#( -y|Y|yes|Yes|YES) - DX_FLAG_doc=1 - - -;; #( -n|N|no|No|NO) - DX_FLAG_doc=0 - -;; #( -*) - as_fn_error $? "invalid value '$enableval' given to doxygen-doc" "$LINENO" 5 -;; -esac - -else $as_nop - -DX_FLAG_doc=1 - - - -fi - -if test "$DX_FLAG_doc" = 1; then - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}doxygen", so it can be a program name with args. -set dummy ${ac_tool_prefix}doxygen; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_DX_DOXYGEN+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $DX_DOXYGEN in - [\\/]* | ?:[\\/]*) - ac_cv_path_DX_DOXYGEN="$DX_DOXYGEN" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_DX_DOXYGEN="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -DX_DOXYGEN=$ac_cv_path_DX_DOXYGEN -if test -n "$DX_DOXYGEN"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DX_DOXYGEN" >&5 -printf "%s\n" "$DX_DOXYGEN" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - -fi -if test -z "$ac_cv_path_DX_DOXYGEN"; then - ac_pt_DX_DOXYGEN=$DX_DOXYGEN - # Extract the first word of "doxygen", so it can be a program name with args. -set dummy doxygen; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_ac_pt_DX_DOXYGEN+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $ac_pt_DX_DOXYGEN in - [\\/]* | ?:[\\/]*) - ac_cv_path_ac_pt_DX_DOXYGEN="$ac_pt_DX_DOXYGEN" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_DX_DOXYGEN="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -ac_pt_DX_DOXYGEN=$ac_cv_path_ac_pt_DX_DOXYGEN -if test -n "$ac_pt_DX_DOXYGEN"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_DOXYGEN" >&5 -printf "%s\n" "$ac_pt_DX_DOXYGEN" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - if test "x$ac_pt_DX_DOXYGEN" = x; then - DX_DOXYGEN="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - DX_DOXYGEN=$ac_pt_DX_DOXYGEN - fi -else - DX_DOXYGEN="$ac_cv_path_DX_DOXYGEN" -fi - -if test "$DX_FLAG_doc$DX_DOXYGEN" = 1; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: doxygen not found - will not generate any doxygen documentation" >&5 -printf "%s\n" "$as_me: WARNING: doxygen not found - will not generate any doxygen documentation" >&2;} - DX_FLAG_doc=0 - -fi - - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}perl", so it can be a program name with args. -set dummy ${ac_tool_prefix}perl; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_DX_PERL+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $DX_PERL in - [\\/]* | ?:[\\/]*) - ac_cv_path_DX_PERL="$DX_PERL" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_DX_PERL="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -DX_PERL=$ac_cv_path_DX_PERL -if test -n "$DX_PERL"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DX_PERL" >&5 -printf "%s\n" "$DX_PERL" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - -fi -if test -z "$ac_cv_path_DX_PERL"; then - ac_pt_DX_PERL=$DX_PERL - # Extract the first word of "perl", so it can be a program name with args. -set dummy perl; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_ac_pt_DX_PERL+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $ac_pt_DX_PERL in - [\\/]* | ?:[\\/]*) - ac_cv_path_ac_pt_DX_PERL="$ac_pt_DX_PERL" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_DX_PERL="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -ac_pt_DX_PERL=$ac_cv_path_ac_pt_DX_PERL -if test -n "$ac_pt_DX_PERL"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_PERL" >&5 -printf "%s\n" "$ac_pt_DX_PERL" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - if test "x$ac_pt_DX_PERL" = x; then - DX_PERL="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - DX_PERL=$ac_pt_DX_PERL - fi -else - DX_PERL="$ac_cv_path_DX_PERL" -fi - -if test "$DX_FLAG_doc$DX_PERL" = 1; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: perl not found - will not generate any doxygen documentation" >&5 -printf "%s\n" "$as_me: WARNING: perl not found - will not generate any doxygen documentation" >&2;} - DX_FLAG_doc=0 - -fi - - : -fi -if test "$DX_FLAG_doc" = 1; then - DX_ENV="$DX_ENV PERL_PATH='$DX_PERL'" -PERL_PATH=$DX_PERL - - : -else - - : -fi - - -# Dot for graphics: - - - - # Check whether --enable-doxygen-dot was given. -if test ${enable_doxygen_dot+y} -then : - enableval=$enable_doxygen_dot; -case "$enableval" in -#( -y|Y|yes|Yes|YES) - DX_FLAG_dot=1 - - -test "$DX_FLAG_doc" = "1" \ -|| as_fn_error $? "doxygen-dot requires doxygen-doc" "$LINENO" 5 - -;; #( -n|N|no|No|NO) - DX_FLAG_dot=0 - -;; #( -*) - as_fn_error $? "invalid value '$enableval' given to doxygen-dot" "$LINENO" 5 -;; -esac - -else $as_nop - -DX_FLAG_dot=0 - - -test "$DX_FLAG_doc" = "1" || DX_FLAG_dot=0 - - - -fi - -if test "$DX_FLAG_dot" = 1; then - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}dot", so it can be a program name with args. -set dummy ${ac_tool_prefix}dot; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_DX_DOT+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $DX_DOT in - [\\/]* | ?:[\\/]*) - ac_cv_path_DX_DOT="$DX_DOT" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_DX_DOT="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -DX_DOT=$ac_cv_path_DX_DOT -if test -n "$DX_DOT"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DX_DOT" >&5 -printf "%s\n" "$DX_DOT" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - -fi -if test -z "$ac_cv_path_DX_DOT"; then - ac_pt_DX_DOT=$DX_DOT - # Extract the first word of "dot", so it can be a program name with args. -set dummy dot; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_ac_pt_DX_DOT+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $ac_pt_DX_DOT in - [\\/]* | ?:[\\/]*) - ac_cv_path_ac_pt_DX_DOT="$ac_pt_DX_DOT" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_DX_DOT="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -ac_pt_DX_DOT=$ac_cv_path_ac_pt_DX_DOT -if test -n "$ac_pt_DX_DOT"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_DOT" >&5 -printf "%s\n" "$ac_pt_DX_DOT" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - if test "x$ac_pt_DX_DOT" = x; then - DX_DOT="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - DX_DOT=$ac_pt_DX_DOT - fi -else - DX_DOT="$ac_cv_path_DX_DOT" -fi - -if test "$DX_FLAG_dot$DX_DOT" = 1; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: dot not found - will not generate graphics for doxygen documentation" >&5 -printf "%s\n" "$as_me: WARNING: dot not found - will not generate graphics for doxygen documentation" >&2;} - DX_FLAG_dot=0 - -fi - - : -fi -if test "$DX_FLAG_dot" = 1; then - DX_ENV="$DX_ENV HAVE_DOT='YES'" -HAVE_DOT=YES - - DX_ENV="$DX_ENV DOT_PATH='`expr ".$DX_DOT" : '\(\.\)[^/]*$' \| "x$DX_DOT" : 'x\(.*\)/[^/]*$'`'" -DOT_PATH=`expr ".$DX_DOT" : '\(\.\)[^/]*$' \| "x$DX_DOT" : 'x\(.*\)/[^/]*$'` - - : -else - DX_ENV="$DX_ENV HAVE_DOT='NO'" -HAVE_DOT=NO - - : -fi - - -# Man pages generation: - - - - # Check whether --enable-doxygen-man was given. -if test ${enable_doxygen_man+y} -then : - enableval=$enable_doxygen_man; -case "$enableval" in -#( -y|Y|yes|Yes|YES) - DX_FLAG_man=1 - - -test "$DX_FLAG_doc" = "1" \ -|| as_fn_error $? "doxygen-man requires doxygen-doc" "$LINENO" 5 - -;; #( -n|N|no|No|NO) - DX_FLAG_man=0 - -;; #( -*) - as_fn_error $? "invalid value '$enableval' given to doxygen-man" "$LINENO" 5 -;; -esac - -else $as_nop - -DX_FLAG_man=1 - - -test "$DX_FLAG_doc" = "1" || DX_FLAG_man=0 - - - -fi - -if test "$DX_FLAG_man" = 1; then - - : -fi -if test "$DX_FLAG_man" = 1; then - DX_ENV="$DX_ENV GENERATE_MAN='YES'" -GENERATE_MAN=YES - - : -else - DX_ENV="$DX_ENV GENERATE_MAN='NO'" -GENERATE_MAN=NO - - : -fi - - -# RTF file generation: - - - - # Check whether --enable-doxygen-rtf was given. -if test ${enable_doxygen_rtf+y} -then : - enableval=$enable_doxygen_rtf; -case "$enableval" in -#( -y|Y|yes|Yes|YES) - DX_FLAG_rtf=1 - - -test "$DX_FLAG_doc" = "1" \ -|| as_fn_error $? "doxygen-rtf requires doxygen-doc" "$LINENO" 5 - -;; #( -n|N|no|No|NO) - DX_FLAG_rtf=0 - -;; #( -*) - as_fn_error $? "invalid value '$enableval' given to doxygen-rtf" "$LINENO" 5 -;; -esac - -else $as_nop - -DX_FLAG_rtf=0 - - -test "$DX_FLAG_doc" = "1" || DX_FLAG_rtf=0 - - - -fi - -if test "$DX_FLAG_rtf" = 1; then - - : -fi -if test "$DX_FLAG_rtf" = 1; then - DX_ENV="$DX_ENV GENERATE_RTF='YES'" -GENERATE_RTF=YES - - : -else - DX_ENV="$DX_ENV GENERATE_RTF='NO'" -GENERATE_RTF=NO - - : -fi - - -# XML file generation: - - - - # Check whether --enable-doxygen-xml was given. -if test ${enable_doxygen_xml+y} -then : - enableval=$enable_doxygen_xml; -case "$enableval" in -#( -y|Y|yes|Yes|YES) - DX_FLAG_xml=1 - - -test "$DX_FLAG_doc" = "1" \ -|| as_fn_error $? "doxygen-xml requires doxygen-doc" "$LINENO" 5 - -;; #( -n|N|no|No|NO) - DX_FLAG_xml=0 - -;; #( -*) - as_fn_error $? "invalid value '$enableval' given to doxygen-xml" "$LINENO" 5 -;; -esac - -else $as_nop - -DX_FLAG_xml=0 - - -test "$DX_FLAG_doc" = "1" || DX_FLAG_xml=0 - - - -fi - -if test "$DX_FLAG_xml" = 1; then - - : -fi -if test "$DX_FLAG_xml" = 1; then - DX_ENV="$DX_ENV GENERATE_XML='YES'" -GENERATE_XML=YES - - : -else - DX_ENV="$DX_ENV GENERATE_XML='NO'" -GENERATE_XML=NO - - : -fi - - -# (Compressed) HTML help generation: - - - - # Check whether --enable-doxygen-chm was given. -if test ${enable_doxygen_chm+y} -then : - enableval=$enable_doxygen_chm; -case "$enableval" in -#( -y|Y|yes|Yes|YES) - DX_FLAG_chm=1 - - -test "$DX_FLAG_doc" = "1" \ -|| as_fn_error $? "doxygen-chm requires doxygen-doc" "$LINENO" 5 - -;; #( -n|N|no|No|NO) - DX_FLAG_chm=0 - -;; #( -*) - as_fn_error $? "invalid value '$enableval' given to doxygen-chm" "$LINENO" 5 -;; -esac - -else $as_nop - -DX_FLAG_chm=0 - - -test "$DX_FLAG_doc" = "1" || DX_FLAG_chm=0 - - - -fi - -if test "$DX_FLAG_chm" = 1; then - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}hhc", so it can be a program name with args. -set dummy ${ac_tool_prefix}hhc; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_DX_HHC+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $DX_HHC in - [\\/]* | ?:[\\/]*) - ac_cv_path_DX_HHC="$DX_HHC" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_DX_HHC="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -DX_HHC=$ac_cv_path_DX_HHC -if test -n "$DX_HHC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DX_HHC" >&5 -printf "%s\n" "$DX_HHC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - -fi -if test -z "$ac_cv_path_DX_HHC"; then - ac_pt_DX_HHC=$DX_HHC - # Extract the first word of "hhc", so it can be a program name with args. -set dummy hhc; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_ac_pt_DX_HHC+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $ac_pt_DX_HHC in - [\\/]* | ?:[\\/]*) - ac_cv_path_ac_pt_DX_HHC="$ac_pt_DX_HHC" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_DX_HHC="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -ac_pt_DX_HHC=$ac_cv_path_ac_pt_DX_HHC -if test -n "$ac_pt_DX_HHC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_HHC" >&5 -printf "%s\n" "$ac_pt_DX_HHC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - if test "x$ac_pt_DX_HHC" = x; then - DX_HHC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - DX_HHC=$ac_pt_DX_HHC - fi -else - DX_HHC="$ac_cv_path_DX_HHC" -fi - -if test "$DX_FLAG_chm$DX_HHC" = 1; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: hhc not found - will not generate doxygen compressed HTML help documentation" >&5 -printf "%s\n" "$as_me: WARNING: hhc not found - will not generate doxygen compressed HTML help documentation" >&2;} - DX_FLAG_chm=0 - -fi - - : -fi -if test "$DX_FLAG_chm" = 1; then - DX_ENV="$DX_ENV HHC_PATH='$DX_HHC'" -HHC_PATH=$DX_HHC - - DX_ENV="$DX_ENV GENERATE_HTML='YES'" -GENERATE_HTML=YES - - DX_ENV="$DX_ENV GENERATE_HTMLHELP='YES'" -GENERATE_HTMLHELP=YES - - : -else - DX_ENV="$DX_ENV GENERATE_HTMLHELP='NO'" -GENERATE_HTMLHELP=NO - - : -fi - - -# Separate CHI file generation. - - - - # Check whether --enable-doxygen-chi was given. -if test ${enable_doxygen_chi+y} -then : - enableval=$enable_doxygen_chi; -case "$enableval" in -#( -y|Y|yes|Yes|YES) - DX_FLAG_chi=1 - - -test "$DX_FLAG_chm" = "1" \ -|| as_fn_error $? "doxygen-chi requires doxygen-chm" "$LINENO" 5 - -;; #( -n|N|no|No|NO) - DX_FLAG_chi=0 - -;; #( -*) - as_fn_error $? "invalid value '$enableval' given to doxygen-chi" "$LINENO" 5 -;; -esac - -else $as_nop - -DX_FLAG_chi=0 - - -test "$DX_FLAG_chm" = "1" || DX_FLAG_chi=0 - - - -fi - -if test "$DX_FLAG_chi" = 1; then - - : -fi -if test "$DX_FLAG_chi" = 1; then - DX_ENV="$DX_ENV GENERATE_CHI='YES'" -GENERATE_CHI=YES - - : -else - DX_ENV="$DX_ENV GENERATE_CHI='NO'" -GENERATE_CHI=NO - - : -fi - - -# Plain HTML pages generation: - - - - # Check whether --enable-doxygen-html was given. -if test ${enable_doxygen_html+y} -then : - enableval=$enable_doxygen_html; -case "$enableval" in -#( -y|Y|yes|Yes|YES) - DX_FLAG_html=1 - - -test "$DX_FLAG_doc" = "1" \ -|| as_fn_error $? "doxygen-html requires doxygen-doc" "$LINENO" 5 - -test "$DX_FLAG_chm" = "0" \ -|| as_fn_error $? "doxygen-html contradicts doxygen-chm" "$LINENO" 5 - -;; #( -n|N|no|No|NO) - DX_FLAG_html=0 - -;; #( -*) - as_fn_error $? "invalid value '$enableval' given to doxygen-html" "$LINENO" 5 -;; -esac - -else $as_nop - -DX_FLAG_html=1 - - -test "$DX_FLAG_doc" = "1" || DX_FLAG_html=0 - - -test "$DX_FLAG_chm" = "0" || DX_FLAG_html=0 - - - -fi - -if test "$DX_FLAG_html" = 1; then - - : -fi -if test "$DX_FLAG_html" = 1; then - DX_ENV="$DX_ENV GENERATE_HTML='YES'" -GENERATE_HTML=YES - - : -else - test "$DX_FLAG_chm" = 1 || DX_ENV="$DX_ENV GENERATE_HTML='NO'" -GENERATE_HTML=NO - - : -fi - - -# PostScript file generation: - - - - # Check whether --enable-doxygen-ps was given. -if test ${enable_doxygen_ps+y} -then : - enableval=$enable_doxygen_ps; -case "$enableval" in -#( -y|Y|yes|Yes|YES) - DX_FLAG_ps=1 - - -test "$DX_FLAG_doc" = "1" \ -|| as_fn_error $? "doxygen-ps requires doxygen-doc" "$LINENO" 5 - -;; #( -n|N|no|No|NO) - DX_FLAG_ps=0 - -;; #( -*) - as_fn_error $? "invalid value '$enableval' given to doxygen-ps" "$LINENO" 5 -;; -esac - -else $as_nop - -DX_FLAG_ps=1 - - -test "$DX_FLAG_doc" = "1" || DX_FLAG_ps=0 - - - -fi - -if test "$DX_FLAG_ps" = 1; then - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}latex", so it can be a program name with args. -set dummy ${ac_tool_prefix}latex; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_DX_LATEX+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $DX_LATEX in - [\\/]* | ?:[\\/]*) - ac_cv_path_DX_LATEX="$DX_LATEX" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_DX_LATEX="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -DX_LATEX=$ac_cv_path_DX_LATEX -if test -n "$DX_LATEX"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DX_LATEX" >&5 -printf "%s\n" "$DX_LATEX" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - -fi -if test -z "$ac_cv_path_DX_LATEX"; then - ac_pt_DX_LATEX=$DX_LATEX - # Extract the first word of "latex", so it can be a program name with args. -set dummy latex; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_ac_pt_DX_LATEX+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $ac_pt_DX_LATEX in - [\\/]* | ?:[\\/]*) - ac_cv_path_ac_pt_DX_LATEX="$ac_pt_DX_LATEX" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_DX_LATEX="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -ac_pt_DX_LATEX=$ac_cv_path_ac_pt_DX_LATEX -if test -n "$ac_pt_DX_LATEX"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_LATEX" >&5 -printf "%s\n" "$ac_pt_DX_LATEX" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - if test "x$ac_pt_DX_LATEX" = x; then - DX_LATEX="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - DX_LATEX=$ac_pt_DX_LATEX - fi -else - DX_LATEX="$ac_cv_path_DX_LATEX" -fi - -if test "$DX_FLAG_ps$DX_LATEX" = 1; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: latex not found - will not generate doxygen PostScript documentation" >&5 -printf "%s\n" "$as_me: WARNING: latex not found - will not generate doxygen PostScript documentation" >&2;} - DX_FLAG_ps=0 - -fi - - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}makeindex", so it can be a program name with args. -set dummy ${ac_tool_prefix}makeindex; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_DX_MAKEINDEX+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $DX_MAKEINDEX in - [\\/]* | ?:[\\/]*) - ac_cv_path_DX_MAKEINDEX="$DX_MAKEINDEX" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_DX_MAKEINDEX="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -DX_MAKEINDEX=$ac_cv_path_DX_MAKEINDEX -if test -n "$DX_MAKEINDEX"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DX_MAKEINDEX" >&5 -printf "%s\n" "$DX_MAKEINDEX" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - -fi -if test -z "$ac_cv_path_DX_MAKEINDEX"; then - ac_pt_DX_MAKEINDEX=$DX_MAKEINDEX - # Extract the first word of "makeindex", so it can be a program name with args. -set dummy makeindex; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_ac_pt_DX_MAKEINDEX+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $ac_pt_DX_MAKEINDEX in - [\\/]* | ?:[\\/]*) - ac_cv_path_ac_pt_DX_MAKEINDEX="$ac_pt_DX_MAKEINDEX" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_DX_MAKEINDEX="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -ac_pt_DX_MAKEINDEX=$ac_cv_path_ac_pt_DX_MAKEINDEX -if test -n "$ac_pt_DX_MAKEINDEX"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_MAKEINDEX" >&5 -printf "%s\n" "$ac_pt_DX_MAKEINDEX" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - if test "x$ac_pt_DX_MAKEINDEX" = x; then - DX_MAKEINDEX="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - DX_MAKEINDEX=$ac_pt_DX_MAKEINDEX - fi -else - DX_MAKEINDEX="$ac_cv_path_DX_MAKEINDEX" -fi - -if test "$DX_FLAG_ps$DX_MAKEINDEX" = 1; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: makeindex not found - will not generate doxygen PostScript documentation" >&5 -printf "%s\n" "$as_me: WARNING: makeindex not found - will not generate doxygen PostScript documentation" >&2;} - DX_FLAG_ps=0 - -fi - - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}dvips", so it can be a program name with args. -set dummy ${ac_tool_prefix}dvips; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_DX_DVIPS+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $DX_DVIPS in - [\\/]* | ?:[\\/]*) - ac_cv_path_DX_DVIPS="$DX_DVIPS" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_DX_DVIPS="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -DX_DVIPS=$ac_cv_path_DX_DVIPS -if test -n "$DX_DVIPS"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DX_DVIPS" >&5 -printf "%s\n" "$DX_DVIPS" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - -fi -if test -z "$ac_cv_path_DX_DVIPS"; then - ac_pt_DX_DVIPS=$DX_DVIPS - # Extract the first word of "dvips", so it can be a program name with args. -set dummy dvips; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_ac_pt_DX_DVIPS+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $ac_pt_DX_DVIPS in - [\\/]* | ?:[\\/]*) - ac_cv_path_ac_pt_DX_DVIPS="$ac_pt_DX_DVIPS" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_DX_DVIPS="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -ac_pt_DX_DVIPS=$ac_cv_path_ac_pt_DX_DVIPS -if test -n "$ac_pt_DX_DVIPS"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_DVIPS" >&5 -printf "%s\n" "$ac_pt_DX_DVIPS" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - if test "x$ac_pt_DX_DVIPS" = x; then - DX_DVIPS="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - DX_DVIPS=$ac_pt_DX_DVIPS - fi -else - DX_DVIPS="$ac_cv_path_DX_DVIPS" -fi - -if test "$DX_FLAG_ps$DX_DVIPS" = 1; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: dvips not found - will not generate doxygen PostScript documentation" >&5 -printf "%s\n" "$as_me: WARNING: dvips not found - will not generate doxygen PostScript documentation" >&2;} - DX_FLAG_ps=0 - -fi - - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}egrep", so it can be a program name with args. -set dummy ${ac_tool_prefix}egrep; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_DX_EGREP+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $DX_EGREP in - [\\/]* | ?:[\\/]*) - ac_cv_path_DX_EGREP="$DX_EGREP" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_DX_EGREP="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -DX_EGREP=$ac_cv_path_DX_EGREP -if test -n "$DX_EGREP"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DX_EGREP" >&5 -printf "%s\n" "$DX_EGREP" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - -fi -if test -z "$ac_cv_path_DX_EGREP"; then - ac_pt_DX_EGREP=$DX_EGREP - # Extract the first word of "egrep", so it can be a program name with args. -set dummy egrep; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_ac_pt_DX_EGREP+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $ac_pt_DX_EGREP in - [\\/]* | ?:[\\/]*) - ac_cv_path_ac_pt_DX_EGREP="$ac_pt_DX_EGREP" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_DX_EGREP="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -ac_pt_DX_EGREP=$ac_cv_path_ac_pt_DX_EGREP -if test -n "$ac_pt_DX_EGREP"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_EGREP" >&5 -printf "%s\n" "$ac_pt_DX_EGREP" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - if test "x$ac_pt_DX_EGREP" = x; then - DX_EGREP="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - DX_EGREP=$ac_pt_DX_EGREP - fi -else - DX_EGREP="$ac_cv_path_DX_EGREP" -fi - -if test "$DX_FLAG_ps$DX_EGREP" = 1; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: egrep not found - will not generate doxygen PostScript documentation" >&5 -printf "%s\n" "$as_me: WARNING: egrep not found - will not generate doxygen PostScript documentation" >&2;} - DX_FLAG_ps=0 - -fi - - : -fi -if test "$DX_FLAG_ps" = 1; then - - : -else - - : -fi - - -# PDF file generation: - - - - # Check whether --enable-doxygen-pdf was given. -if test ${enable_doxygen_pdf+y} -then : - enableval=$enable_doxygen_pdf; -case "$enableval" in -#( -y|Y|yes|Yes|YES) - DX_FLAG_pdf=1 - - -test "$DX_FLAG_doc" = "1" \ -|| as_fn_error $? "doxygen-pdf requires doxygen-doc" "$LINENO" 5 - -;; #( -n|N|no|No|NO) - DX_FLAG_pdf=0 - -;; #( -*) - as_fn_error $? "invalid value '$enableval' given to doxygen-pdf" "$LINENO" 5 -;; -esac - -else $as_nop - -DX_FLAG_pdf=1 - - -test "$DX_FLAG_doc" = "1" || DX_FLAG_pdf=0 - - - -fi - -if test "$DX_FLAG_pdf" = 1; then - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}pdflatex", so it can be a program name with args. -set dummy ${ac_tool_prefix}pdflatex; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_DX_PDFLATEX+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $DX_PDFLATEX in - [\\/]* | ?:[\\/]*) - ac_cv_path_DX_PDFLATEX="$DX_PDFLATEX" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_DX_PDFLATEX="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -DX_PDFLATEX=$ac_cv_path_DX_PDFLATEX -if test -n "$DX_PDFLATEX"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DX_PDFLATEX" >&5 -printf "%s\n" "$DX_PDFLATEX" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - -fi -if test -z "$ac_cv_path_DX_PDFLATEX"; then - ac_pt_DX_PDFLATEX=$DX_PDFLATEX - # Extract the first word of "pdflatex", so it can be a program name with args. -set dummy pdflatex; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_ac_pt_DX_PDFLATEX+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $ac_pt_DX_PDFLATEX in - [\\/]* | ?:[\\/]*) - ac_cv_path_ac_pt_DX_PDFLATEX="$ac_pt_DX_PDFLATEX" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_DX_PDFLATEX="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -ac_pt_DX_PDFLATEX=$ac_cv_path_ac_pt_DX_PDFLATEX -if test -n "$ac_pt_DX_PDFLATEX"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_PDFLATEX" >&5 -printf "%s\n" "$ac_pt_DX_PDFLATEX" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - if test "x$ac_pt_DX_PDFLATEX" = x; then - DX_PDFLATEX="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - DX_PDFLATEX=$ac_pt_DX_PDFLATEX - fi -else - DX_PDFLATEX="$ac_cv_path_DX_PDFLATEX" -fi - -if test "$DX_FLAG_pdf$DX_PDFLATEX" = 1; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: pdflatex not found - will not generate doxygen PDF documentation" >&5 -printf "%s\n" "$as_me: WARNING: pdflatex not found - will not generate doxygen PDF documentation" >&2;} - DX_FLAG_pdf=0 - -fi - - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}makeindex", so it can be a program name with args. -set dummy ${ac_tool_prefix}makeindex; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_DX_MAKEINDEX+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $DX_MAKEINDEX in - [\\/]* | ?:[\\/]*) - ac_cv_path_DX_MAKEINDEX="$DX_MAKEINDEX" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_DX_MAKEINDEX="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -DX_MAKEINDEX=$ac_cv_path_DX_MAKEINDEX -if test -n "$DX_MAKEINDEX"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DX_MAKEINDEX" >&5 -printf "%s\n" "$DX_MAKEINDEX" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - -fi -if test -z "$ac_cv_path_DX_MAKEINDEX"; then - ac_pt_DX_MAKEINDEX=$DX_MAKEINDEX - # Extract the first word of "makeindex", so it can be a program name with args. -set dummy makeindex; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_ac_pt_DX_MAKEINDEX+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $ac_pt_DX_MAKEINDEX in - [\\/]* | ?:[\\/]*) - ac_cv_path_ac_pt_DX_MAKEINDEX="$ac_pt_DX_MAKEINDEX" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_DX_MAKEINDEX="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -ac_pt_DX_MAKEINDEX=$ac_cv_path_ac_pt_DX_MAKEINDEX -if test -n "$ac_pt_DX_MAKEINDEX"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_MAKEINDEX" >&5 -printf "%s\n" "$ac_pt_DX_MAKEINDEX" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - if test "x$ac_pt_DX_MAKEINDEX" = x; then - DX_MAKEINDEX="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - DX_MAKEINDEX=$ac_pt_DX_MAKEINDEX - fi -else - DX_MAKEINDEX="$ac_cv_path_DX_MAKEINDEX" -fi - -if test "$DX_FLAG_pdf$DX_MAKEINDEX" = 1; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: makeindex not found - will not generate doxygen PDF documentation" >&5 -printf "%s\n" "$as_me: WARNING: makeindex not found - will not generate doxygen PDF documentation" >&2;} - DX_FLAG_pdf=0 - -fi - - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}egrep", so it can be a program name with args. -set dummy ${ac_tool_prefix}egrep; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_DX_EGREP+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $DX_EGREP in - [\\/]* | ?:[\\/]*) - ac_cv_path_DX_EGREP="$DX_EGREP" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_DX_EGREP="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -DX_EGREP=$ac_cv_path_DX_EGREP -if test -n "$DX_EGREP"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DX_EGREP" >&5 -printf "%s\n" "$DX_EGREP" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - -fi -if test -z "$ac_cv_path_DX_EGREP"; then - ac_pt_DX_EGREP=$DX_EGREP - # Extract the first word of "egrep", so it can be a program name with args. -set dummy egrep; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_ac_pt_DX_EGREP+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $ac_pt_DX_EGREP in - [\\/]* | ?:[\\/]*) - ac_cv_path_ac_pt_DX_EGREP="$ac_pt_DX_EGREP" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_DX_EGREP="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -ac_pt_DX_EGREP=$ac_cv_path_ac_pt_DX_EGREP -if test -n "$ac_pt_DX_EGREP"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_EGREP" >&5 -printf "%s\n" "$ac_pt_DX_EGREP" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - if test "x$ac_pt_DX_EGREP" = x; then - DX_EGREP="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - DX_EGREP=$ac_pt_DX_EGREP - fi -else - DX_EGREP="$ac_cv_path_DX_EGREP" -fi - -if test "$DX_FLAG_pdf$DX_EGREP" = 1; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: egrep not found - will not generate doxygen PDF documentation" >&5 -printf "%s\n" "$as_me: WARNING: egrep not found - will not generate doxygen PDF documentation" >&2;} - DX_FLAG_pdf=0 +GPU_SHAREDMEM=$with_shared_mem -fi +if test x$HAVE_CUDA = x0 +then : + GPU_SHAREDMEM=0 - : fi -if test "$DX_FLAG_pdf" = 1; then - : -else +# +# Bifrost memory alignment +# - : -fi +# Check whether --with-alignment was given. +if test ${with_alignment+y} +then : + withval=$with_alignment; +else $as_nop + with_alignment=4096 +fi -# LaTeX generation for PS and/or PDF: -if test "$DX_FLAG_ps" = 1 || test "$DX_FLAG_pdf" = 1; then - DX_ENV="$DX_ENV GENERATE_LATEX='YES'" -GENERATE_LATEX=YES +ALIGNMENT=$with_alignment -else - DX_ENV="$DX_ENV GENERATE_LATEX='NO'" -GENERATE_LATEX=NO -fi +# +# Bifrost proclog location +# -# Paper size for PS and/or PDF: -case "$DOXYGEN_PAPER_SIZE" in -#( -"") - DOXYGEN_PAPER_SIZE="" -;; #( -a4wide|a4|letter|legal|executive) - DX_ENV="$DX_ENV PAPER_SIZE='$DOXYGEN_PAPER_SIZE'" -PAPER_SIZE=$DOXYGEN_PAPER_SIZE -;; #( -*) - as_fn_error $? "unknown DOXYGEN_PAPER_SIZE='$DOXYGEN_PAPER_SIZE'" "$LINENO" 5 -;; -esac -# Rules: -if test $DX_FLAG_html -eq 1 +# Check whether --with-logging_dir was given. +if test ${with_logging_dir+y} then : - DX_SNIPPET_html="## ------------------------------- ## -## Rules specific for HTML output. ## -## ------------------------------- ## - -DX_CLEAN_HTML = \$(DX_DOCDIR)/html\\ - \$(DX_DOCDIR)/html + withval=$with_logging_dir; HAVE_TMPFS=$with_logging_dir -" else $as_nop - DX_SNIPPET_html="" + HAVE_TMPFS=/tmp + fi -if test $DX_FLAG_chi -eq 1 + + + if test "$HAVE_TMPFS" = "/tmp"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for /dev/shm" >&5 +printf %s "checking for /dev/shm... " >&6; } +if test ${ac_cv_file__dev_shm+y} then : - DX_SNIPPET_chi=" -DX_CLEAN_CHI = \$(DX_DOCDIR)/\$(PACKAGE).chi\\ - \$(DX_DOCDIR)/\$(PACKAGE).chi" + printf %s "(cached) " >&6 else $as_nop - DX_SNIPPET_chi="" + test "$cross_compiling" = yes && + as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 +if test -r "/dev/shm"; then + ac_cv_file__dev_shm=yes +else + ac_cv_file__dev_shm=no +fi fi -if test $DX_FLAG_chm -eq 1 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__dev_shm" >&5 +printf "%s\n" "$ac_cv_file__dev_shm" >&6; } +if test "x$ac_cv_file__dev_shm" = xyes then : - DX_SNIPPET_chm="## ------------------------------ ## -## Rules specific for CHM output. ## -## ------------------------------ ## + HAVE_TMPFS=/dev/shm/bifrost -DX_CLEAN_CHM = \$(DX_DOCDIR)/chm\\ - \$(DX_DOCDIR)/chm\ -${DX_SNIPPET_chi} +fi -" + fi + + if test "$HAVE_TMPFS" = "/tmp"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for /Volumes/RAMDisk" >&5 +printf %s "checking for /Volumes/RAMDisk... " >&6; } +if test ${ac_cv_file__Volumes_RAMDisk+y} +then : + printf %s "(cached) " >&6 else $as_nop - DX_SNIPPET_chm="" + test "$cross_compiling" = yes && + as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 +if test -r "/Volumes/RAMDisk"; then + ac_cv_file__Volumes_RAMDisk=yes +else + ac_cv_file__Volumes_RAMDisk=no fi -if test $DX_FLAG_man -eq 1 +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__Volumes_RAMDisk" >&5 +printf "%s\n" "$ac_cv_file__Volumes_RAMDisk" >&6; } +if test "x$ac_cv_file__Volumes_RAMDisk" = xyes then : - DX_SNIPPET_man="## ------------------------------ ## -## Rules specific for MAN output. ## -## ------------------------------ ## + HAVE_TMPFS=/Volumes/RAMDisk/bifrost -DX_CLEAN_MAN = \$(DX_DOCDIR)/man\\ - \$(DX_DOCDIR)/man +fi -" + fi + + if test "$HAVE_TMPFS" = "/tmp"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for /tmp" >&5 +printf %s "checking for /tmp... " >&6; } +if test ${ac_cv_file__tmp+y} +then : + printf %s "(cached) " >&6 else $as_nop - DX_SNIPPET_man="" + test "$cross_compiling" = yes && + as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 +if test -r "/tmp"; then + ac_cv_file__tmp=yes +else + ac_cv_file__tmp=no +fi fi -if test $DX_FLAG_rtf -eq 1 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__tmp" >&5 +printf "%s\n" "$ac_cv_file__tmp" >&6; } +if test "x$ac_cv_file__tmp" = xyes then : - DX_SNIPPET_rtf="## ------------------------------ ## -## Rules specific for RTF output. ## -## ------------------------------ ## + HAVE_TMPFS=/tmp -DX_CLEAN_RTF = \$(DX_DOCDIR)/rtf\\ - \$(DX_DOCDIR)/rtf +fi -" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $HAVE_TMPFS may have performance problems for logging" >&5 +printf "%s\n" "$as_me: WARNING: $HAVE_TMPFS may have performance problems for logging" >&2;} + HAVE_TMPFS=/tmp/bifrost + + fi + + +# +# Bifrost Features +# + +# Check whether --enable-debug was given. +if test ${enable_debug+y} +then : + enableval=$enable_debug; enable_debug=yes else $as_nop - DX_SNIPPET_rtf="" + enable_debug=no fi -if test $DX_FLAG_xml -eq 1 + +HAVE_DEBUG=0 + +if test x$enable_debug != xno then : - DX_SNIPPET_xml="## ------------------------------ ## -## Rules specific for XML output. ## -## ------------------------------ ## + HAVE_DEBUG=1 -DX_CLEAN_XML = \$(DX_DOCDIR)/xml\\ - \$(DX_DOCDIR)/xml + CXXFLAGS="$CXXFLAGS -g" + NVCCFLAGS="$NVCCFLAGS -g" +fi -" +# Check whether --enable-trace was given. +if test ${enable_trace+y} +then : + enableval=$enable_trace; enable_trace=yes else $as_nop - DX_SNIPPET_xml="" + enable_trace=no fi -if test $DX_FLAG_ps -eq 1 -then : - DX_SNIPPET_ps="## ----------------------------- ## -## Rules specific for PS output. ## -## ----------------------------- ## -DX_CLEAN_PS = \$(DX_DOCDIR)/\$(PACKAGE).ps\\ - \$(DX_DOCDIR)/\$(PACKAGE).ps +HAVE_TRACE=0 + +if test x$enable_trace != xno +then : + HAVE_TRACE=1 -DX_PS_GOAL = doxygen-ps +fi -doxygen-ps: \$(DX_CLEAN_PS) -\$(DX_DOCDIR)/\$(PACKAGE).ps: \$(DX_DOCDIR)/\$(PACKAGE).tag - \$(DX_V_LATEX)cd \$(DX_DOCDIR)/latex; \\ - rm -f *.aux *.toc *.idx *.ind *.ilg *.log *.out; \\ - \$(DX_LATEX) refman.tex; \\ - \$(DX_MAKEINDEX) refman.idx; \\ - \$(DX_LATEX) refman.tex; \\ - countdown=5; \\ - while \$(DX_EGREP) 'Rerun (LaTeX|to get cross-references right)' \\ - refman.log > /dev/null 2>&1 \\ - && test \$\$countdown -gt 0; do \\ - \$(DX_LATEX) refman.tex; \\ - countdown=\`expr \$\$countdown - 1\`; \\ - done; \\ - \$(DX_DVIPS) -o ../\$(PACKAGE).ps refman.dvi -" + # Check whether --enable-native_arch was given. +if test ${enable_native_arch+y} +then : + enableval=$enable_native_arch; enable_native_arch=no else $as_nop - DX_SNIPPET_ps="" + enable_native_arch=yes fi -if test $DX_FLAG_pdf -eq 1 -then : - DX_SNIPPET_pdf="## ------------------------------ ## -## Rules specific for PDF output. ## -## ------------------------------ ## -DX_CLEAN_PDF = \$(DX_DOCDIR)/\$(PACKAGE).pdf\\ - \$(DX_DOCDIR)/\$(PACKAGE).pdf -DX_PDF_GOAL = doxygen-pdf + if test "$enable_native_arch" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the compiler accepts '-march=native'" >&5 +printf %s "checking if the compiler accepts '-march=native'... " >&6; } + + CXXFLAGS_temp="$CXXFLAGS -march=native" + + ac_compile='$CXX -c $CXXFLAGS_temp conftest.$ac_ext >&5' + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -doxygen-pdf: \$(DX_CLEAN_PDF) -\$(DX_DOCDIR)/\$(PACKAGE).pdf: \$(DX_DOCDIR)/\$(PACKAGE).tag - \$(DX_V_LATEX)cd \$(DX_DOCDIR)/latex; \\ - rm -f *.aux *.toc *.idx *.ind *.ilg *.log *.out; \\ - \$(DX_PDFLATEX) refman.tex; \\ - \$(DX_MAKEINDEX) refman.idx; \\ - \$(DX_PDFLATEX) refman.tex; \\ - countdown=5; \\ - while \$(DX_EGREP) 'Rerun (LaTeX|to get cross-references right)' \\ - refman.log > /dev/null 2>&1 \\ - && test \$\$countdown -gt 0; do \\ - \$(DX_PDFLATEX) refman.tex; \\ - countdown=\`expr \$\$countdown - 1\`; \\ - done; \\ - mv refman.pdf ../\$(PACKAGE).pdf -" +int +main (void) +{ + + int i = 5; + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + CXXFLAGS="$CXXFLAGS -march=native" + NVCCFLAGS="$NVCCFLAGS -Xcompiler \"-march=native\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } else $as_nop - DX_SNIPPET_pdf="" + enable_native_arch=no + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -if test $DX_FLAG_ps -eq 1 -o $DX_FLAG_pdf -eq 1 +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + fi + + +# Check whether --enable-cuda_debug was given. +if test ${enable_cuda_debug+y} then : - DX_SNIPPET_latex="## ------------------------------------------------- ## -## Rules specific for LaTeX (shared for PS and PDF). ## -## ------------------------------------------------- ## + enableval=$enable_cuda_debug; enable_cuda_debug=yes +else $as_nop + enable_cuda_debug=no +fi -DX_V_LATEX = \$(_DX_v_LATEX_\$(V)) -_DX_v_LATEX_ = \$(_DX_v_LATEX_\$(AM_DEFAULT_VERBOSITY)) -_DX_v_LATEX_0 = @echo \" LATEX \" \$@; +HAVE_CUDA_DEBUG=0 -DX_CLEAN_LATEX = \$(DX_DOCDIR)/latex\\ - \$(DX_DOCDIR)/latex +if test x$enable_cuda_debug != xno +then : + HAVE_CUDA_DEBUG=1 -" + NVCCFLAGS="$NVCCFLAGS -G" +fi + + + +# Check whether --with-mapped_ring_dir was given. +if test ${with_mapped_ring_dir+y} +then : + withval=$with_mapped_ring_dir; else $as_nop - DX_SNIPPET_latex="" + mapped_ring_dir=/tmp/bifrost fi -if test $DX_FLAG_doc -eq 1 +CPPFLAGS="$CPPFLAGS -DBF_MAPPED_RING_DIR=\"$mapped_ring_dir\"" + +# +# Python +# + +# Check whether --enable-python was given. +if test ${enable_python+y} then : - DX_SNIPPET_doc="## --------------------------------- ## -## Format-independent Doxygen rules. ## -## --------------------------------- ## + enableval=$enable_python; enable_python=no +else $as_nop + enable_python=yes +fi + +HAVE_PYTHON=0 -${DX_SNIPPET_html}\ -${DX_SNIPPET_chm}\ -${DX_SNIPPET_man}\ -${DX_SNIPPET_rtf}\ -${DX_SNIPPET_xml}\ -${DX_SNIPPET_ps}\ -${DX_SNIPPET_pdf}\ -${DX_SNIPPET_latex}\ -DX_V_DXGEN = \$(_DX_v_DXGEN_\$(V)) -_DX_v_DXGEN_ = \$(_DX_v_DXGEN_\$(AM_DEFAULT_VERBOSITY)) -_DX_v_DXGEN_0 = @echo \" DXGEN \" \$<; +if test x$enable_python != xno +then : + AX_WITH_PROG(PYTHON, python, no, $PATH) + if test x${PYTHON} != xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $PYTHON as ctypesgen" >&5 +printf %s "checking whether $PYTHON as ctypesgen... " >&6; } + if ! ${PYTHON} -c "import ctypesgen" 2>/dev/null +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: python module will not be built" >&5 +printf "%s\n" "$as_me: WARNING: python module will not be built" >&2;} +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + HAVE_PYTHON=1 -.PHONY: doxygen-run doxygen-doc \$(DX_PS_GOAL) \$(DX_PDF_GOAL) +fi +fi +fi -.INTERMEDIATE: doxygen-run \$(DX_PS_GOAL) \$(DX_PDF_GOAL) +# Check whether --with-pybuild_flags was given. +if test ${with_pybuild_flags+y} +then : + withval=$with_pybuild_flags; +fi -doxygen-run: \$(DX_DOCDIR)/\$(PACKAGE).tag +PYBUILDFLAGS=$with_pybuild_flags -doxygen-doc: doxygen-run \$(DX_PS_GOAL) \$(DX_PDF_GOAL) -\$(DX_DOCDIR)/\$(PACKAGE).tag: \$(DX_CONFIG) \$(pkginclude_HEADERS) - \$(A""M_V_at)rm -rf \$(DX_DOCDIR) - \$(DX_V_DXGEN)\$(DX_ENV) DOCDIR=\$(DX_DOCDIR) \$(DX_DOXYGEN) \$(DX_CONFIG) - \$(A""M_V_at)echo Timestamp >\$@ -DX_CLEANFILES = \\ - \$(DX_DOCDIR)/doxygen_sqlite3.db \\ - \$(DX_DOCDIR)/\$(PACKAGE).tag \\ - -r \\ - \$(DX_CLEAN_HTML) \\ - \$(DX_CLEAN_CHM) \\ - \$(DX_CLEAN_CHI) \\ - \$(DX_CLEAN_MAN) \\ - \$(DX_CLEAN_RTF) \\ - \$(DX_CLEAN_XML) \\ - \$(DX_CLEAN_PS) \\ - \$(DX_CLEAN_PDF) \\ - \$(DX_CLEAN_LATEX)" -else $as_nop - DX_SNIPPET_doc="" +# Check whether --with-pyinstall_flags was given. +if test ${with_pyinstall_flags+y} +then : + withval=$with_pyinstall_flags; fi -DX_RULES="${DX_SNIPPET_doc}" +PYINSTALLFLAGS=$with_pyinstall_flags + + +# +# Docker +# + +AX_WITH_PROG(DOCKER, docker, no, $PATH) +if test x${DOCKER} != xno +then : + HAVE_DOCKER=1 + +fi -#For debugging: -#echo DX_FLAG_doc=$DX_FLAG_doc -#echo DX_FLAG_dot=$DX_FLAG_dot -#echo DX_FLAG_man=$DX_FLAG_man -#echo DX_FLAG_html=$DX_FLAG_html -#echo DX_FLAG_chm=$DX_FLAG_chm -#echo DX_FLAG_chi=$DX_FLAG_chi -#echo DX_FLAG_rtf=$DX_FLAG_rtf -#echo DX_FLAG_xml=$DX_FLAG_xml -#echo DX_FLAG_pdf=$DX_FLAG_pdf -#echo DX_FLAG_ps=$DX_FLAG_ps -#echo DX_ENV=$DX_ENV +# +# Documentation +# +DX_DOT_FEATURE(OFF) +DX_HTML_FEATURE(ON) +DX_CHM_FEATURE(OFF) +DX_CHI_FEATURE(OFF) +DX_MAN_FEATURE(ON) +DX_RTF_FEATURE(OFF) +DX_XML_FEATURE(OFF) +DX_PDF_FEATURE(ON) +DX_PS_FEATURE(ON) +DX_INIT_DOXYGEN(bifrost) # # Version splitting From e60ae31fce77e159619a49bd2bb3fb4c8c35d2a7 Mon Sep 17 00:00:00 2001 From: jaycedowell Date: Tue, 22 Mar 2022 13:03:35 -0600 Subject: [PATCH 26/48] Rebuild configure correctly. --- configure | 5839 ++++++++++++++++++++++++++++++++++++++++---------- configure.ac | 2 + 2 files changed, 4683 insertions(+), 1158 deletions(-) diff --git a/configure b/configure index 042ac0a6e..a392c243a 100755 --- a/configure +++ b/configure @@ -661,9 +661,50 @@ LTLIBOBJS PACKAGE_VERSION_MICRO PACKAGE_VERSION_MINOR PACKAGE_VERSION_MAJOR +DX_RULES +PAPER_SIZE +DOXYGEN_PAPER_SIZE +GENERATE_LATEX +DX_PDFLATEX +DX_FLAG_pdf +DX_EGREP +DX_DVIPS +DX_MAKEINDEX +DX_LATEX +DX_FLAG_ps +DX_FLAG_html +GENERATE_CHI +DX_FLAG_chi +GENERATE_HTMLHELP +GENERATE_HTML +HHC_PATH +DX_HHC +DX_FLAG_chm +GENERATE_XML +DX_FLAG_xml +GENERATE_RTF +DX_FLAG_rtf +GENERATE_MAN +DX_FLAG_man +DOT_PATH +HAVE_DOT +DX_DOT +DX_FLAG_dot +PERL_PATH +DX_PERL +DX_DOXYGEN +DX_FLAG_doc +PROJECT +SRCDIR +DX_ENV +DX_DOCDIR +DX_CONFIG +DX_PROJECT HAVE_DOCKER +DOCKER PYINSTALLFLAGS PYBUILDFLAGS +PYTHON HAVE_PYTHON HAVE_CUDA_DEBUG enable_native_arch @@ -689,7 +730,10 @@ HAVE_FLOAT128 HAVE_OPENMP LIBOBJS HAVE_RECVMSG +HAVE_CXX11 +HAVE_CXX14 SO_EXT +CTAGS SET_MAKE INSTALL_DATA INSTALL_SCRIPT @@ -788,6 +832,7 @@ with_aix_soname with_gnu_ld with_sysroot enable_libtool_lock +with_ctags enable_numa enable_hwloc enable_vma @@ -804,8 +849,20 @@ enable_native_arch enable_cuda_debug with_mapped_ring_dir enable_python +with_python with_pybuild_flags with_pyinstall_flags +with_docker +enable_doxygen_doc +enable_doxygen_dot +enable_doxygen_man +enable_doxygen_rtf +enable_doxygen_xml +enable_doxygen_chm +enable_doxygen_chi +enable_doxygen_html +enable_doxygen_ps +enable_doxygen_pdf ' ac_precious_vars='build_alias host_alias @@ -819,7 +876,11 @@ CXX CXXFLAGS CCC LT_SYS_LIBRARY_PATH -CXXCPP' +CXXCPP +CTAGS +PYTHON +DOCKER +DOXYGEN_PAPER_SIZE' # Initialize some variables set by options. @@ -1456,6 +1517,17 @@ Optional Features: --disable-native-arch disable native architecture compilation (default=no) --enable-cuda-debug enable CUDA debugging (nvcc -G; default=no) --disable-python disable building the Python bindings (default=no) + --disable-doxygen-doc don't generate any doxygen documentation + --enable-doxygen-dot generate graphics for doxygen documentation + --disable-doxygen-man don't generate doxygen manual pages + --enable-doxygen-rtf generate doxygen RTF documentation + --enable-doxygen-xml generate doxygen XML documentation + --enable-doxygen-chm generate doxygen compressed HTML help documentation + --enable-doxygen-chi generate doxygen separate compressed HTML help index + file + --disable-doxygen-html don't generate doxygen plain HTML documentation + --disable-doxygen-ps don't generate doxygen PostScript documentation + --disable-doxygen-pdf don't generate doxygen PDF documentation Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -1468,6 +1540,7 @@ Optional Packages: --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified). + --with-ctags=[PATH] absolute path to ctags executable --with-cuda-home CUDA install path (default=/usr/local/cuda) --with-nvcc-flags flags to pass to NVCC (default='-O3 -Xcompiler "-Wall"') @@ -1479,8 +1552,10 @@ Optional Packages: --with-mapped-ring-dir=... directory to store mapped ring files in (default=/tmp/bifrost) + --with-python=[PATH] absolute path to python executable --with-pybuild-flags build flags for python (default='') --with-pyinstall-flags install flags for python (default='') + --with-docker=[PATH] absolute path to docker executable Some influential environment variables: CC C compiler command @@ -1495,6 +1570,11 @@ Some influential environment variables: LT_SYS_LIBRARY_PATH User-defined run-time library search path. CXXCPP C++ preprocessor + CTAGS Absolute path to ctags executable + PYTHON Absolute path to python executable + DOCKER Absolute path to docker executable + DOXYGEN_PAPER_SIZE + a4wide (default), a4, letter, legal or executive Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. @@ -17367,7 +17447,151 @@ printf "%s\n" "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi -AX_WITH_PROG(CTAGS, ctags) + + + + + + + + + + + if test -z "$CTAGS" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ctags executable path has been provided" >&5 +printf %s "checking whether ctags executable path has been provided... " >&6; } + +# Check whether --with-ctags was given. +if test ${with_ctags+y} +then : + withval=$with_ctags; + if test "$withval" != yes && test "$withval" != no +then : + + CTAGS="$withval" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CTAGS" >&5 +printf "%s\n" "$CTAGS" >&6; } + +else $as_nop + + CTAGS="" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + if test "$withval" != no +then : + + # Extract the first word of "ctags", so it can be a program name with args. +set dummy ctags; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_CTAGS+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $CTAGS in + [\\/]* | ?:[\\/]*) + ac_cv_path_CTAGS="$CTAGS" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_CTAGS="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +CTAGS=$ac_cv_path_CTAGS +if test -n "$CTAGS"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CTAGS" >&5 +printf "%s\n" "$CTAGS" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + +fi + +fi + +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + # Extract the first word of "ctags", so it can be a program name with args. +set dummy ctags; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_CTAGS+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $CTAGS in + [\\/]* | ?:[\\/]*) + ac_cv_path_CTAGS="$CTAGS" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_CTAGS="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +CTAGS=$ac_cv_path_CTAGS +if test -n "$CTAGS"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CTAGS" >&5 +printf "%s\n" "$CTAGS" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + +fi + + +fi + + + + + + if test x${CTAGS} = x then : as_fn_error $? "Required program ctags was not found" "$LINENO" 5 @@ -17435,1465 +17659,4761 @@ _ACEOF ;; esac -AX_CXX_COMPILE_STDCXX(14, noext, optional) -if test x$HAVE_CXX14 != x1 -then : - AX_CXX_COMPILE_STDCXX(11, noext, mandatory) -fi -ac_fn_cxx_check_func "$LINENO" "memset" "ac_cv_func_memset" -if test "x$ac_cv_func_memset" = xyes -then : - printf "%s\n" "#define HAVE_MEMSET 1" >>confdefs.h + ax_cxx_compile_alternatives="14 1y" ax_cxx_compile_cxx14_required=false + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + ac_success=no -fi -ac_fn_cxx_check_func "$LINENO" "rint" "ac_cv_func_rint" -if test "x$ac_cv_func_rint" = xyes -then : - printf "%s\n" "#define HAVE_RINT 1" >>confdefs.h -fi -ac_fn_cxx_check_func "$LINENO" "socket" "ac_cv_func_socket" -if test "x$ac_cv_func_socket" = xyes + + if test x$ac_success = xno; then + for alternative in ${ax_cxx_compile_alternatives}; do + for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}"; do + cachevar=`printf "%s\n" "ax_cv_cxx_compile_cxx14_$switch" | $as_tr_sh` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++14 features with $switch" >&5 +printf %s "checking whether $CXX supports C++14 features with $switch... " >&6; } +if eval test \${$cachevar+y} then : - printf "%s\n" "#define HAVE_SOCKET 1" >>confdefs.h + printf %s "(cached) " >&6 +else $as_nop + ac_save_CXX="$CXX" + CXX="$CXX $switch" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -fi +// If the compiler admits that it is not ready for C++11, why torture it? +// Hopefully, this will speed up the test. - for ac_func in recvmsg -do : - ac_fn_cxx_check_func "$LINENO" "recvmsg" "ac_cv_func_recvmsg" -if test "x$ac_cv_func_recvmsg" = xyes -then : - printf "%s\n" "#define HAVE_RECVMSG 1" >>confdefs.h - HAVE_RECVMSG=1 +#ifndef __cplusplus -else $as_nop - HAVE_RECVMSG=0 +#error "This is not a C++ compiler" -fi +#elif __cplusplus < 201103L -done -ac_fn_cxx_check_func "$LINENO" "sqrt" "ac_cv_func_sqrt" -if test "x$ac_cv_func_sqrt" = xyes -then : - printf "%s\n" "#define HAVE_SQRT 1" >>confdefs.h +#error "This is not a C++11 compiler" -fi +#else -ac_fn_cxx_check_func "$LINENO" "strerror" "ac_cv_func_strerror" -if test "x$ac_cv_func_strerror" = xyes -then : - printf "%s\n" "#define HAVE_STRERROR 1" >>confdefs.h +namespace cxx11 +{ -fi + namespace test_static_assert + { -ac_fn_cxx_check_header_compile "$LINENO" "arpa/inet.h" "ac_cv_header_arpa_inet_h" "$ac_includes_default" -if test "x$ac_cv_header_arpa_inet_h" = xyes -then : - printf "%s\n" "#define HAVE_ARPA_INET_H 1" >>confdefs.h + template + struct check + { + static_assert(sizeof(int) <= sizeof(T), "not big enough"); + }; -fi + } -ac_fn_cxx_check_header_compile "$LINENO" "netdb.h" "ac_cv_header_netdb_h" "$ac_includes_default" -if test "x$ac_cv_header_netdb_h" = xyes -then : - printf "%s\n" "#define HAVE_NETDB_H 1" >>confdefs.h + namespace test_final_override + { -fi + struct Base + { + virtual ~Base() {} + virtual void f() {} + }; -ac_fn_cxx_check_header_compile "$LINENO" "netinet/in.h" "ac_cv_header_netinet_in_h" "$ac_includes_default" -if test "x$ac_cv_header_netinet_in_h" = xyes -then : - printf "%s\n" "#define HAVE_NETINET_IN_H 1" >>confdefs.h + struct Derived : public Base + { + virtual ~Derived() override {} + virtual void f() override {} + }; -fi + } -ac_fn_cxx_check_header_compile "$LINENO" "sys/file.h" "ac_cv_header_sys_file_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_file_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_FILE_H 1" >>confdefs.h + namespace test_double_right_angle_brackets + { -fi + template < typename T > + struct check {}; -ac_fn_cxx_check_header_compile "$LINENO" "sys/ioctl.h" "ac_cv_header_sys_ioctl_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_ioctl_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_IOCTL_H 1" >>confdefs.h + typedef check single_type; + typedef check> double_type; + typedef check>> triple_type; + typedef check>>> quadruple_type; -fi + } -ac_fn_cxx_check_header_compile "$LINENO" "sys/socket.h" "ac_cv_header_sys_socket_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_socket_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_SOCKET_H 1" >>confdefs.h + namespace test_decltype + { -fi + int + f() + { + int a = 1; + decltype(a) b = 2; + return a + b; + } -ac_fn_cxx_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default" -if test "x$ac_cv_type__Bool" = xyes -then : + } -printf "%s\n" "#define HAVE__BOOL 1" >>confdefs.h + namespace test_type_deduction + { + template < typename T1, typename T2 > + struct is_same + { + static const bool value = false; + }; -fi + template < typename T > + struct is_same + { + static const bool value = true; + }; - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5 -printf %s "checking for stdbool.h that conforms to C99... " >&6; } -if test ${ac_cv_header_stdbool_h+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include + template < typename T1, typename T2 > + auto + add(T1 a1, T2 a2) -> decltype(a1 + a2) + { + return a1 + a2; + } - #ifndef __bool_true_false_are_defined - #error "__bool_true_false_are_defined is not defined" - #endif - char a[__bool_true_false_are_defined == 1 ? 1 : -1]; + int + test(const int c, volatile int v) + { + static_assert(is_same::value == true, ""); + static_assert(is_same::value == false, ""); + static_assert(is_same::value == false, ""); + auto ac = c; + auto av = v; + auto sumi = ac + av + 'x'; + auto sumf = ac + av + 1.0; + static_assert(is_same::value == true, ""); + static_assert(is_same::value == true, ""); + static_assert(is_same::value == true, ""); + static_assert(is_same::value == false, ""); + static_assert(is_same::value == true, ""); + return (sumf > 0.0) ? sumi : add(c, v); + } - /* Regardless of whether this is C++ or "_Bool" is a - valid type name, "true" and "false" should be usable - in #if expressions and integer constant expressions, - and "bool" should be a valid type name. */ + } - #if !true - #error "'true' is not true" - #endif - #if true != 1 - #error "'true' is not equal to 1" - #endif - char b[true == 1 ? 1 : -1]; - char c[true]; + namespace test_noexcept + { - #if false - #error "'false' is not false" - #endif - #if false != 0 - #error "'false' is not equal to 0" - #endif - char d[false == 0 ? 1 : -1]; + int f() { return 0; } + int g() noexcept { return 0; } - enum { e = false, f = true, g = false * true, h = true * 256 }; + static_assert(noexcept(f()) == false, ""); + static_assert(noexcept(g()) == true, ""); - char i[(bool) 0.5 == true ? 1 : -1]; - char j[(bool) 0.0 == false ? 1 : -1]; - char k[sizeof (bool) > 0 ? 1 : -1]; + } - struct sb { bool s: 1; bool t; } s; - char l[sizeof s.t > 0 ? 1 : -1]; + namespace test_constexpr + { - /* The following fails for - HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ - bool m[h]; - char n[sizeof m == h * sizeof m[0] ? 1 : -1]; - char o[-1 - (bool) 0 < 0 ? 1 : -1]; - /* Catch a bug in an HP-UX C compiler. See - https://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html - https://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html - */ - bool p = true; - bool *pp = &p; + template < typename CharT > + unsigned long constexpr + strlen_c_r(const CharT *const s, const unsigned long acc) noexcept + { + return *s ? strlen_c_r(s + 1, acc + 1) : acc; + } - /* C 1999 specifies that bool, true, and false are to be - macros, but C++ 2011 and later overrule this. */ - #if __cplusplus < 201103 - #ifndef bool - #error "bool is not defined" - #endif - #ifndef false - #error "false is not defined" - #endif - #ifndef true - #error "true is not defined" - #endif - #endif + template < typename CharT > + unsigned long constexpr + strlen_c(const CharT *const s) noexcept + { + return strlen_c_r(s, 0UL); + } - /* If _Bool is available, repeat with it all the tests - above that used bool. */ - #ifdef HAVE__BOOL - struct sB { _Bool s: 1; _Bool t; } t; + static_assert(strlen_c("") == 0UL, ""); + static_assert(strlen_c("1") == 1UL, ""); + static_assert(strlen_c("example") == 7UL, ""); + static_assert(strlen_c("another\0example") == 7UL, ""); - char q[(_Bool) 0.5 == true ? 1 : -1]; - char r[(_Bool) 0.0 == false ? 1 : -1]; - char u[sizeof (_Bool) > 0 ? 1 : -1]; - char v[sizeof t.t > 0 ? 1 : -1]; + } - _Bool w[h]; - char x[sizeof m == h * sizeof m[0] ? 1 : -1]; - char y[-1 - (_Bool) 0 < 0 ? 1 : -1]; - _Bool z = true; - _Bool *pz = &p; - #endif + namespace test_rvalue_references + { -int -main (void) -{ + template < int N > + struct answer + { + static constexpr int value = N; + }; - bool ps = &s; - *pp |= p; - *pp |= ! p; + answer<1> f(int&) { return answer<1>(); } + answer<2> f(const int&) { return answer<2>(); } + answer<3> f(int&&) { return answer<3>(); } - #ifdef HAVE__BOOL - _Bool pt = &t; - *pz |= z; - *pz |= ! z; - #endif + void + test() + { + int i = 0; + const int c = 0; + static_assert(decltype(f(i))::value == 1, ""); + static_assert(decltype(f(c))::value == 2, ""); + static_assert(decltype(f(0))::value == 3, ""); + } - /* Refer to every declared value, so they cannot be - discarded as unused. */ - return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !j + !k - + !l + !m + !n + !o + !p + !pp + !ps - #ifdef HAVE__BOOL - + !q + !r + !u + !v + !w + !x + !y + !z + !pt - #endif - ); + } - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : - ac_cv_header_stdbool_h=yes -else $as_nop - ac_cv_header_stdbool_h=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5 -printf "%s\n" "$ac_cv_header_stdbool_h" >&6; } + namespace test_uniform_initialization + { -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5 -printf %s "checking for GNU libc compatible malloc... " >&6; } -if test ${ac_cv_func_malloc_0_nonnull+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test "$cross_compiling" = yes -then : - case "$host_os" in # (( - # Guess yes on platforms where we know the result. - *-gnu* | freebsd* | netbsd* | openbsd* | bitrig* \ - | hpux* | solaris* | cygwin* | mingw* | msys* ) - ac_cv_func_malloc_0_nonnull=yes ;; - # If we don't know, assume the worst. - *) ac_cv_func_malloc_0_nonnull=no ;; - esac -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include + struct test + { + static const int zero {}; + static const int one {1}; + }; -int -main (void) -{ -void *p = malloc (0); - int result = !p; - free (p); - return result; - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_run "$LINENO" -then : - ac_cv_func_malloc_0_nonnull=yes -else $as_nop - ac_cv_func_malloc_0_nonnull=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi + static_assert(test::zero == 0, ""); + static_assert(test::one == 1, ""); -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5 -printf "%s\n" "$ac_cv_func_malloc_0_nonnull" >&6; } -if test $ac_cv_func_malloc_0_nonnull = yes -then : + } -printf "%s\n" "#define HAVE_MALLOC 1" >>confdefs.h + namespace test_lambdas + { -else $as_nop - printf "%s\n" "#define HAVE_MALLOC 0" >>confdefs.h + void + test1() + { + auto lambda1 = [](){}; + auto lambda2 = lambda1; + lambda1(); + lambda2(); + } - case " $LIBOBJS " in - *" malloc.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS malloc.$ac_objext" - ;; -esac + int + test2() + { + auto a = [](int i, int j){ return i + j; }(1, 2); + auto b = []() -> int { return '0'; }(); + auto c = [=](){ return a + b; }(); + auto d = [&](){ return c; }(); + auto e = [a, &b](int x) mutable { + const auto identity = [](int y){ return y; }; + for (auto i = 0; i < a; ++i) + a += b--; + return x + identity(a + b); + }(0); + return a + b + c + d + e; + } + int + test3() + { + const auto nullary = [](){ return 0; }; + const auto unary = [](int x){ return x; }; + using nullary_t = decltype(nullary); + using unary_t = decltype(unary); + const auto higher1st = [](nullary_t f){ return f(); }; + const auto higher2nd = [unary](nullary_t f1){ + return [unary, f1](unary_t f2){ return f2(unary(f1())); }; + }; + return higher1st(nullary) + higher2nd(nullary)(unary); + } -printf "%s\n" "#define malloc rpl_malloc" >>confdefs.h + } -fi + namespace test_variadic_templates + { + template + struct sum; + template + struct sum + { + static constexpr auto value = N0 + sum::value; + }; -HAVE_OPENMP=0 + template <> + struct sum<> + { + static constexpr auto value = 0; + }; -AX_OPENMP -if test x$OPENMP_CXXFLAGS != x -then : - HAVE_OPENMP=1 + static_assert(sum<>::value == 0, ""); + static_assert(sum<1>::value == 1, ""); + static_assert(sum<23>::value == 23, ""); + static_assert(sum<1, 2>::value == 3, ""); + static_assert(sum<5, 5, 11>::value == 21, ""); + static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); -fi -if test x$HAVE_OPENMP != x1 -then : + } -else $as_nop - CXXFLAGS="$CXXFLAGS $OPENMP_CXXFLAGS" - LDFLAGS="$LDFLAGS $OPENMP_CXXFLAGS" -fi + // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae + // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function + // because of this. + namespace test_template_alias_sfinae + { -ac_fn_cxx_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default" -if test "x$ac_cv_type_ptrdiff_t" = xyes -then : + struct foo {}; -printf "%s\n" "#define HAVE_PTRDIFF_T 1" >>confdefs.h + template + using member = typename T::member_type; + template + void func(...) {} -fi + template + void func(member*) {} -ac_fn_c_find_intX_t "$LINENO" "16" "ac_cv_c_int16_t" -case $ac_cv_c_int16_t in #( - no|yes) ;; #( - *) + void test(); -printf "%s\n" "#define int16_t $ac_cv_c_int16_t" >>confdefs.h -;; -esac + void test() { func(0); } -ac_fn_c_find_intX_t "$LINENO" "32" "ac_cv_c_int32_t" -case $ac_cv_c_int32_t in #( - no|yes) ;; #( - *) + } -printf "%s\n" "#define int32_t $ac_cv_c_int32_t" >>confdefs.h -;; -esac +} // namespace cxx11 -ac_fn_c_find_intX_t "$LINENO" "64" "ac_cv_c_int64_t" -case $ac_cv_c_int64_t in #( - no|yes) ;; #( - *) +#endif // __cplusplus >= 201103L -printf "%s\n" "#define int64_t $ac_cv_c_int64_t" >>confdefs.h -;; -esac -ac_fn_c_find_intX_t "$LINENO" "8" "ac_cv_c_int8_t" -case $ac_cv_c_int8_t in #( - no|yes) ;; #( - *) -printf "%s\n" "#define int8_t $ac_cv_c_int8_t" >>confdefs.h -;; -esac +// If the compiler admits that it is not ready for C++14, why torture it? +// Hopefully, this will speed up the test. - ac_fn_cxx_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default -" -if test "x$ac_cv_type_pid_t" = xyes -then : +#ifndef __cplusplus -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +#error "This is not a C++ compiler" - #if defined _WIN64 && !defined __CYGWIN__ - LLP64 - #endif +#elif __cplusplus < 201402L -int -main (void) +#error "This is not a C++14 compiler" + +#else + +namespace cxx14 { - ; - return 0; -} + namespace test_polymorphic_lambdas + { -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : - ac_pid_type='int' -else $as_nop - ac_pid_type='__int64' -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + int + test() + { + const auto lambda = [](auto&&... args){ + const auto istiny = [](auto x){ + return (sizeof(x) == 1UL) ? 1 : 0; + }; + const int aretiny[] = { istiny(args)... }; + return aretiny[0]; + }; + return lambda(1, 1L, 1.0f, '1'); + } -printf "%s\n" "#define pid_t $ac_pid_type" >>confdefs.h + } + namespace test_binary_literals + { -fi + constexpr auto ivii = 0b0000000000101010; + static_assert(ivii == 42, "wrong value"); + } -ac_fn_cxx_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" -if test "x$ac_cv_type_size_t" = xyes -then : + namespace test_generalized_constexpr + { -else $as_nop + template < typename CharT > + constexpr unsigned long + strlen_c(const CharT *const s) noexcept + { + auto length = 0UL; + for (auto p = s; *p; ++p) + ++length; + return length; + } -printf "%s\n" "#define size_t unsigned int" >>confdefs.h + static_assert(strlen_c("") == 0UL, ""); + static_assert(strlen_c("x") == 1UL, ""); + static_assert(strlen_c("test") == 4UL, ""); + static_assert(strlen_c("another\0test") == 7UL, ""); -fi + } -ac_fn_cxx_check_type "$LINENO" "ssize_t" "ac_cv_type_ssize_t" "$ac_includes_default" -if test "x$ac_cv_type_ssize_t" = xyes -then : + namespace test_lambda_init_capture + { -else $as_nop + int + test() + { + auto x = 0; + const auto lambda1 = [a = x](int b){ return a + b; }; + const auto lambda2 = [a = lambda1(x)](){ return a; }; + return lambda2(); + } -printf "%s\n" "#define ssize_t int" >>confdefs.h + } -fi + namespace test_digit_separators + { -ac_fn_c_find_uintX_t "$LINENO" "16" "ac_cv_c_uint16_t" -case $ac_cv_c_uint16_t in #( - no|yes) ;; #( - *) - - -printf "%s\n" "#define uint16_t $ac_cv_c_uint16_t" >>confdefs.h -;; - esac - -ac_fn_c_find_uintX_t "$LINENO" "32" "ac_cv_c_uint32_t" -case $ac_cv_c_uint32_t in #( - no|yes) ;; #( - *) - -printf "%s\n" "#define _UINT32_T 1" >>confdefs.h + constexpr auto ten_million = 100'000'000; + static_assert(ten_million == 100000000, ""); + } -printf "%s\n" "#define uint32_t $ac_cv_c_uint32_t" >>confdefs.h -;; - esac - -ac_fn_c_find_uintX_t "$LINENO" "64" "ac_cv_c_uint64_t" -case $ac_cv_c_uint64_t in #( - no|yes) ;; #( - *) - -printf "%s\n" "#define _UINT64_T 1" >>confdefs.h + namespace test_return_type_deduction + { + auto f(int& x) { return x; } + decltype(auto) g(int& x) { return x; } -printf "%s\n" "#define uint64_t $ac_cv_c_uint64_t" >>confdefs.h -;; - esac + template < typename T1, typename T2 > + struct is_same + { + static constexpr auto value = false; + }; -ac_fn_c_find_uintX_t "$LINENO" "8" "ac_cv_c_uint8_t" -case $ac_cv_c_uint8_t in #( - no|yes) ;; #( - *) + template < typename T > + struct is_same + { + static constexpr auto value = true; + }; -printf "%s\n" "#define _UINT8_T 1" >>confdefs.h + int + test() + { + auto x = 0; + static_assert(is_same::value, ""); + static_assert(is_same::value, ""); + return x; + } + } -printf "%s\n" "#define uint8_t $ac_cv_c_uint8_t" >>confdefs.h -;; - esac +} // namespace cxx14 +#endif // __cplusplus >= 201402L - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for long double with more range or precision than double" >&5 -printf %s "checking for long double with more range or precision than double... " >&6; } -if test ${ac_cv_type_long_double_wider+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - long double const a[] = - { - 0.0L, DBL_MIN, DBL_MAX, DBL_EPSILON, - LDBL_MIN, LDBL_MAX, LDBL_EPSILON - }; - long double - f (long double x) - { - return ((x + (unsigned long int) 10) * (-1 / x) + a[0] - + (x ? f (x) : 'c')); - } -int -main (void) -{ -static int test_array [1 - 2 * !((0 < ((DBL_MAX_EXP < LDBL_MAX_EXP) - + (DBL_MANT_DIG < LDBL_MANT_DIG) - - (LDBL_MAX_EXP < DBL_MAX_EXP) - - (LDBL_MANT_DIG < DBL_MANT_DIG))) - && (int) LDBL_EPSILON == 0 - )]; -test_array [0] = 0; -return test_array [0]; - ; - return 0; -} _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : - ac_cv_type_long_double_wider=yes + eval $cachevar=yes else $as_nop - ac_cv_type_long_double_wider=no + eval $cachevar=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + CXX="$ac_save_CXX" fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_double_wider" >&5 -printf "%s\n" "$ac_cv_type_long_double_wider" >&6; } - if test $ac_cv_type_long_double_wider = yes; then +eval ac_res=\$$cachevar + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test x\$$cachevar = xyes; then + CXX="$CXX $switch" + if test -n "$CXXCPP" ; then + CXXCPP="$CXXCPP $switch" + fi + ac_success=yes + break + fi + done + if test x$ac_success = xyes; then + break + fi + done + fi + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -printf "%s\n" "#define HAVE_LONG_DOUBLE_WIDER 1" >>confdefs.h + if test x$ax_cxx_compile_cxx14_required = xtrue; then + if test x$ac_success = xno; then + as_fn_error $? "*** A compiler with support for C++14 language features is required." "$LINENO" 5 + fi + fi + if test x$ac_success = xno; then + HAVE_CXX14=0 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: No compiler with C++14 support was found" >&5 +printf "%s\n" "$as_me: No compiler with C++14 support was found" >&6;} + else + HAVE_CXX14=1 + +printf "%s\n" "#define HAVE_CXX14 1" >>confdefs.h fi -HAVE_FLOAT128=0 -if test x$HAVE_HAVE_LONG_DOUBLE_WIDER = x1 +if test x$HAVE_CXX14 != x1 then : - HAVE_FLOAT128=0 + ax_cxx_compile_alternatives="11 0x" ax_cxx_compile_cxx11_required=true + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + ac_success=no -fi -# -# NUMA -# -# Check whether --enable-numa was given. -if test ${enable_numa+y} -then : - enableval=$enable_numa; enable_numa=no -else $as_nop - enable_numa=yes -fi -HAVE_NUMA=0 -if test x$enable_numa != xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for numa_node_of_cpu in -lnuma" >&5 -printf %s "checking for numa_node_of_cpu in -lnuma... " >&6; } -if test ${ac_cv_lib_numa_numa_node_of_cpu+y} + if test x$ac_success = xno; then + for alternative in ${ax_cxx_compile_alternatives}; do + for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}"; do + cachevar=`printf "%s\n" "ax_cv_cxx_compile_cxx11_$switch" | $as_tr_sh` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features with $switch" >&5 +printf %s "checking whether $CXX supports C++11 features with $switch... " >&6; } +if eval test \${$cachevar+y} then : printf %s "(cached) " >&6 else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-lnuma $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + ac_save_CXX="$CXX" + CXX="$CXX $switch" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -namespace conftest { - extern "C" int numa_node_of_cpu (); -} -int -main (void) -{ -return conftest::numa_node_of_cpu (); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO" -then : - ac_cv_lib_numa_numa_node_of_cpu=yes -else $as_nop - ac_cv_lib_numa_numa_node_of_cpu=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_numa_numa_node_of_cpu" >&5 -printf "%s\n" "$ac_cv_lib_numa_numa_node_of_cpu" >&6; } -if test "x$ac_cv_lib_numa_numa_node_of_cpu" = xyes -then : - HAVE_NUMA=1 - LIBS="$LIBS -lnuma" -fi +// If the compiler admits that it is not ready for C++11, why torture it? +// Hopefully, this will speed up the test. -fi +#ifndef __cplusplus -# -# HWLOC -# +#error "This is not a C++ compiler" -# Check whether --enable-hwloc was given. -if test ${enable_hwloc+y} -then : - enableval=$enable_hwloc; enable_hwloc=no -else $as_nop - enable_hwloc=yes -fi +#elif __cplusplus < 201103L -HAVE_HWLOC=0 +#error "This is not a C++11 compiler" -if test x$enable_hwloc != xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for hwloc_topology_init in -lhwloc" >&5 -printf %s "checking for hwloc_topology_init in -lhwloc... " >&6; } -if test ${ac_cv_lib_hwloc_hwloc_topology_init+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-lhwloc $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +#else -namespace conftest { - extern "C" int hwloc_topology_init (); -} -int -main (void) +namespace cxx11 { -return conftest::hwloc_topology_init (); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO" -then : - ac_cv_lib_hwloc_hwloc_topology_init=yes -else $as_nop - ac_cv_lib_hwloc_hwloc_topology_init=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hwloc_hwloc_topology_init" >&5 -printf "%s\n" "$ac_cv_lib_hwloc_hwloc_topology_init" >&6; } -if test "x$ac_cv_lib_hwloc_hwloc_topology_init" = xyes -then : - HAVE_HWLOC=1 - LIBS="$LIBS -lhwloc" -fi + namespace test_static_assert + { -fi + template + struct check + { + static_assert(sizeof(int) <= sizeof(T), "not big enough"); + }; -# -# VMA -# + } -# Check whether --enable-vma was given. -if test ${enable_vma+y} -then : - enableval=$enable_vma; enable_vma=yes -else $as_nop - enable_vma=no -fi + namespace test_final_override + { -HAVE_VMA=0 + struct Base + { + virtual ~Base() {} + virtual void f() {} + }; -if test x$enable_vma != xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for recvfrom_zcopy in -lvma" >&5 -printf %s "checking for recvfrom_zcopy in -lvma... " >&6; } -if test ${ac_cv_lib_vma_recvfrom_zcopy+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-lvma $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + struct Derived : public Base + { + virtual ~Derived() override {} + virtual void f() override {} + }; -namespace conftest { - extern "C" int recvfrom_zcopy (); -} -int -main (void) -{ -return conftest::recvfrom_zcopy (); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO" -then : - ac_cv_lib_vma_recvfrom_zcopy=yes -else $as_nop - ac_cv_lib_vma_recvfrom_zcopy=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_vma_recvfrom_zcopy" >&5 -printf "%s\n" "$ac_cv_lib_vma_recvfrom_zcopy" >&6; } -if test "x$ac_cv_lib_vma_recvfrom_zcopy" = xyes -then : - HAVE_VMA=1 + } - LIBS="$LIBS -lvma" -fi + namespace test_double_right_angle_brackets + { -fi + template < typename T > + struct check {}; -# -# CUDA -# + typedef check single_type; + typedef check> double_type; + typedef check>> triple_type; + typedef check>>> quadruple_type; -################################# -# NOTE # -# This needs to come after all # -# other compiler/library tests # -# since it changes LIB to # -# include CUDA-specific entries # -################################# + } + namespace test_decltype + { + int + f() + { + int a = 1; + decltype(a) b = 2; + return a + b; + } + } -# Check whether --with-cuda_home was given. -if test ${with_cuda_home+y} -then : - withval=$with_cuda_home; -else $as_nop - with_cuda_home=/usr/local/cuda -fi + namespace test_type_deduction + { - CUDA_HOME=$with_cuda_home + template < typename T1, typename T2 > + struct is_same + { + static const bool value = false; + }; + template < typename T > + struct is_same + { + static const bool value = true; + }; - # Check whether --enable-cuda was given. -if test ${enable_cuda+y} -then : - enableval=$enable_cuda; enable_cuda=no -else $as_nop - enable_cuda=yes -fi + template < typename T1, typename T2 > + auto + add(T1 a1, T2 a2) -> decltype(a1 + a2) + { + return a1 + a2; + } + int + test(const int c, volatile int v) + { + static_assert(is_same::value == true, ""); + static_assert(is_same::value == false, ""); + static_assert(is_same::value == false, ""); + auto ac = c; + auto av = v; + auto sumi = ac + av + 'x'; + auto sumf = ac + av + 1.0; + static_assert(is_same::value == true, ""); + static_assert(is_same::value == true, ""); + static_assert(is_same::value == true, ""); + static_assert(is_same::value == false, ""); + static_assert(is_same::value == true, ""); + return (sumf > 0.0) ? sumi : add(c, v); + } - HAVE_CUDA=0 + } - CUDA_VERSION=0 + namespace test_noexcept + { - GPU_MAX_ARCH=0 + int f() { return 0; } + int g() noexcept { return 0; } - if test "$enable_cuda" != "no"; then - HAVE_CUDA=1 + static_assert(noexcept(f()) == false, ""); + static_assert(noexcept(g()) == true, ""); + } - # Extract the first word of "nvcc", so it can be a program name with args. -set dummy nvcc; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_NVCC+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $NVCC in - [\\/]* | ?:[\\/]*) - ac_cv_path_NVCC="$NVCC" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -as_dummy="$CUDA_HOME/bin:$PATH" -for as_dir in $as_dummy -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_NVCC="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS + namespace test_constexpr + { - test -z "$ac_cv_path_NVCC" && ac_cv_path_NVCC="no" - ;; -esac -fi -NVCC=$ac_cv_path_NVCC -if test -n "$NVCC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $NVCC" >&5 -printf "%s\n" "$NVCC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi + template < typename CharT > + unsigned long constexpr + strlen_c_r(const CharT *const s, const unsigned long acc) noexcept + { + return *s ? strlen_c_r(s + 1, acc + 1) : acc; + } + template < typename CharT > + unsigned long constexpr + strlen_c(const CharT *const s) noexcept + { + return strlen_c_r(s, 0UL); + } - # Extract the first word of "nvprune", so it can be a program name with args. -set dummy nvprune; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_NVPRUNE+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $NVPRUNE in - [\\/]* | ?:[\\/]*) - ac_cv_path_NVPRUNE="$NVPRUNE" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -as_dummy="$CUDA_HOME/bin:$PATH" -for as_dir in $as_dummy -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_NVPRUNE="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS + static_assert(strlen_c("") == 0UL, ""); + static_assert(strlen_c("1") == 1UL, ""); + static_assert(strlen_c("example") == 7UL, ""); + static_assert(strlen_c("another\0example") == 7UL, ""); - test -z "$ac_cv_path_NVPRUNE" && ac_cv_path_NVPRUNE="no" - ;; -esac -fi -NVPRUNE=$ac_cv_path_NVPRUNE -if test -n "$NVPRUNE"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $NVPRUNE" >&5 -printf "%s\n" "$NVPRUNE" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi + } + namespace test_rvalue_references + { - # Extract the first word of "cuobjdump", so it can be a program name with args. -set dummy cuobjdump; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_CUOBJDUMP+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $CUOBJDUMP in - [\\/]* | ?:[\\/]*) - ac_cv_path_CUOBJDUMP="$CUOBJDUMP" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -as_dummy="$CUDA_HOME/bin:$PATH" -for as_dir in $as_dummy -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_CUOBJDUMP="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS + template < int N > + struct answer + { + static constexpr int value = N; + }; - test -z "$ac_cv_path_CUOBJDUMP" && ac_cv_path_CUOBJDUMP="no" - ;; -esac -fi -CUOBJDUMP=$ac_cv_path_CUOBJDUMP -if test -n "$CUOBJDUMP"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CUOBJDUMP" >&5 -printf "%s\n" "$CUOBJDUMP" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi + answer<1> f(int&) { return answer<1>(); } + answer<2> f(const int&) { return answer<2>(); } + answer<3> f(int&&) { return answer<3>(); } + void + test() + { + int i = 0; + const int c = 0; + static_assert(decltype(f(i))::value == 1, ""); + static_assert(decltype(f(c))::value == 2, ""); + static_assert(decltype(f(0))::value == 3, ""); + } - fi + } - if test "$HAVE_CUDA" = "1"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a working CUDA installation" >&5 -printf %s "checking for a working CUDA installation... " >&6; } + namespace test_uniform_initialization + { - CXXFLAGS_save="$CXXFLAGS" - LDFLAGS_save="$LDFLAGS" - LIBS_save="$LIBS" + struct test + { + static const int zero {}; + static const int one {1}; + }; - ac_compile='$NVCC -c $NVCCFLAGS conftest.$ac_ext >&5' - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + static_assert(test::zero == 0, ""); + static_assert(test::one == 1, ""); + } - #include - #include -int -main (void) -{ -cudaMalloc(0, 0); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : + namespace test_lambdas + { -else $as_nop - HAVE_CUDA=0 + void + test1() + { + auto lambda1 = [](){}; + auto lambda2 = lambda1; + lambda1(); + lambda2(); + } -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + int + test2() + { + auto a = [](int i, int j){ return i + j; }(1, 2); + auto b = []() -> int { return '0'; }(); + auto c = [=](){ return a + b; }(); + auto d = [&](){ return c; }(); + auto e = [a, &b](int x) mutable { + const auto identity = [](int y){ return y; }; + for (auto i = 0; i < a; ++i) + a += b--; + return x + identity(a + b); + }(0); + return a + b + c + d + e; + } - if test "$HAVE_CUDA" = "1"; then - LDFLAGS="-L$CUDA_HOME/lib64 -L$CUDA_HOME/lib" - LIBS="$LIBS -lcuda -lcudart" + int + test3() + { + const auto nullary = [](){ return 0; }; + const auto unary = [](int x){ return x; }; + using nullary_t = decltype(nullary); + using unary_t = decltype(unary); + const auto higher1st = [](nullary_t f){ return f(); }; + const auto higher2nd = [unary](nullary_t f1){ + return [unary, f1](unary_t f2){ return f2(unary(f1())); }; + }; + return higher1st(nullary) + higher2nd(nullary)(unary); + } - ac_link='$NVCC -o conftest$ac_exeext $NVCCFLAGS $LDFLAGS $LIBS conftest.$ac_ext >&5' - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + } + namespace test_variadic_templates + { - #include - #include -int -main (void) -{ -cudaMalloc(0, 0); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO" -then : - CUDA_VERSION=$( ${NVCC} --version | ${GREP} -Po -e "release.*," | cut -d, -f1 | cut -d\ -f2 ) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes - v$CUDA_VERSION" >&5 -printf "%s\n" "yes - v$CUDA_VERSION" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - HAVE_CUDA=0 + template + struct sum; -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - HAVE_CUDA=0 + template + struct sum + { + static constexpr auto value = N0 + sum::value; + }; - fi + template <> + struct sum<> + { + static constexpr auto value = 0; + }; - CXXFLAGS="$CXXFLAGS_save" - LDFLAGS="$LDFLAGS_save" - LIBS="$LIBS_save" - fi + static_assert(sum<>::value == 0, ""); + static_assert(sum<1>::value == 1, ""); + static_assert(sum<23>::value == 23, ""); + static_assert(sum<1, 2>::value == 3, ""); + static_assert(sum<5, 5, 11>::value == 21, ""); + static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); + } -# Check whether --with-nvcc_flags was given. -if test ${with_nvcc_flags+y} + // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae + // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function + // because of this. + namespace test_template_alias_sfinae + { + + struct foo {}; + + template + using member = typename T::member_type; + + template + void func(...) {} + + template + void func(member*) {} + + void test(); + + void test() { func(0); } + + } + +} // namespace cxx11 + +#endif // __cplusplus >= 201103L + + + +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" then : - withval=$with_nvcc_flags; + eval $cachevar=yes else $as_nop - with_nvcc_flags='-O3 -Xcompiler "-Wall"' + eval $cachevar=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + CXX="$ac_save_CXX" fi +eval ac_res=\$$cachevar + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test x\$$cachevar = xyes; then + CXX="$CXX $switch" + if test -n "$CXXCPP" ; then + CXXCPP="$CXXCPP $switch" + fi + ac_success=yes + break + fi + done + if test x$ac_success = xyes; then + break + fi + done + fi + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - NVCCFLAGS=$with_nvcc_flags + if test x$ax_cxx_compile_cxx11_required = xtrue; then + if test x$ac_success = xno; then + as_fn_error $? "*** A compiler with support for C++11 language features is required." "$LINENO" 5 + fi + fi + if test x$ac_success = xno; then + HAVE_CXX11=0 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: No compiler with C++11 support was found" >&5 +printf "%s\n" "$as_me: No compiler with C++11 support was found" >&6;} + else + HAVE_CXX11=1 +printf "%s\n" "#define HAVE_CXX11 1" >>confdefs.h - if test "$HAVE_CUDA" = "1"; then - CPPFLAGS="$CPPFLAGS -DBF_CUDA_ENABLED=1" - CXXFLAGS="$CXXFLAGS -DBF_CUDA_ENABLED=1" - NVCCFLAGS="$NVCCFLAGS -DBF_CUDA_ENABLED=1" - LDFLAGS="$LDFLAGS -L$CUDA_HOME/lib64 -L$CUDA_HOME/lib" - LIBS="$LIBS -lcuda -lcudart -lnvrtc -lcublas -lcudadevrt -L. -lcufft_static_pruned -lculibos -lnvToolsExt" fi -# Check whether --with-gpu_archs was given. -if test ${with_gpu_archs+y} -then : - withval=$with_gpu_archs; -else $as_nop - with_gpu_archs='auto' fi +ac_fn_cxx_check_func "$LINENO" "memset" "ac_cv_func_memset" +if test "x$ac_cv_func_memset" = xyes +then : + printf "%s\n" "#define HAVE_MEMSET 1" >>confdefs.h - if test "$HAVE_CUDA" = "1"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for valid CUDA architectures" >&5 -printf %s "checking for valid CUDA architectures... " >&6; } - ar_supported=$( ${NVCC} -h | ${GREP} -Po "'compute_[0-9]{2,3}" | cut -d_ -f2 | sort | uniq ) - ar_supported_flat=$( echo $ar_supported | xargs ) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: found: $ar_supported_flat" >&5 -printf "%s\n" "found: $ar_supported_flat" >&6; } +fi - if test "$with_gpu_archs" = "auto"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking which CUDA architectures to target" >&5 -printf %s "checking which CUDA architectures to target... " >&6; } +ac_fn_cxx_check_func "$LINENO" "rint" "ac_cv_func_rint" +if test "x$ac_cv_func_rint" = xyes +then : + printf "%s\n" "#define HAVE_RINT 1" >>confdefs.h - CXXFLAGS_save="$CXXFLAGS" - LDFLAGS_save="$LDFLAGS" - LIBS_save="$LIBS" +fi - LDFLAGS="-L$CUDA_HOME/lib64 -L$CUDA_HOME/lib" - LIBS="-lcuda -lcudart" - ac_run='$NVCC -o conftest$ac_ext $LDFLAGS $LIBS conftest.$ac_ext>&5' - if test "$cross_compiling" = yes +ac_fn_cxx_check_func "$LINENO" "socket" "ac_cv_func_socket" +if test "x$ac_cv_func_socket" = xyes then : - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run test program while cross compiling -See \`config.log' for more details" "$LINENO" 5; } -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + printf "%s\n" "#define HAVE_SOCKET 1" >>confdefs.h +fi - #include - #include - #include - #include - #include -int -main (void) -{ - std::set archs; - int major, minor, arch; - int deviceCount = 0; - cudaGetDeviceCount(&deviceCount); - if( deviceCount == 0 ) { - return 1; - } - std::ofstream fh; - fh.open("confarchs.out"); - for(int dev=0; dev 0 ) { - fh << " "; - } - fh << arch; - } - arch += minor; - if( archs.count(arch) == 0 ) { - archs.insert(arch); - fh << " " << arch; - } - } - fh.close(); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_run "$LINENO" + for ac_func in recvmsg +do : + ac_fn_cxx_check_func "$LINENO" "recvmsg" "ac_cv_func_recvmsg" +if test "x$ac_cv_func_recvmsg" = xyes then : - GPU_ARCHS=`cat confarchs.out` - - ar_supported=$( ${NVCC} -h | ${GREP} -Po "'compute_[0-9]{2,3}" | cut -d_ -f2 | sort | uniq ) - ar_valid=$( echo $GPU_ARCHS $ar_supported | xargs -n1 | sort | uniq -d | xargs ) - if test "$ar_valid" = ""; then - as_fn_error $? "failed to find any supported" "$LINENO" 5 - else - GPU_ARCHS=$ar_valid + printf "%s\n" "#define HAVE_RECVMSG 1" >>confdefs.h + HAVE_RECVMSG=1 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $GPU_ARCHS" >&5 -printf "%s\n" "$GPU_ARCHS" >&6; } - fi else $as_nop - as_fn_error $? "failed to find any" "$LINENO" 5 + HAVE_RECVMSG=0 + fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + +done +ac_fn_cxx_check_func "$LINENO" "sqrt" "ac_cv_func_sqrt" +if test "x$ac_cv_func_sqrt" = xyes +then : + printf "%s\n" "#define HAVE_SQRT 1" >>confdefs.h + fi +ac_fn_cxx_check_func "$LINENO" "strerror" "ac_cv_func_strerror" +if test "x$ac_cv_func_strerror" = xyes +then : + printf "%s\n" "#define HAVE_STRERROR 1" >>confdefs.h - CXXFLAGS="$CXXFLAGS_save" - LDFLAGS="$LDFLAGS_save" - LIBS="$LIBS_save" - else - GPU_ARCHS=$with_gpu_archs +fi - fi +ac_fn_cxx_check_header_compile "$LINENO" "arpa/inet.h" "ac_cv_header_arpa_inet_h" "$ac_includes_default" +if test "x$ac_cv_header_arpa_inet_h" = xyes +then : + printf "%s\n" "#define HAVE_ARPA_INET_H 1" >>confdefs.h - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for valid requested CUDA architectures" >&5 -printf %s "checking for valid requested CUDA architectures... " >&6; } - ar_requested=$( echo "$GPU_ARCHS" | wc -w ) - ar_valid=$( echo $GPU_ARCHS $ar_supported | xargs -n1 | sort | uniq -d | xargs ) - ar_found=$( echo $ar_valid | wc -w ) - if test "$ar_requested" = "$ar_found"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } - else - as_fn_error $? "only '$ar_valid' are supported" "$LINENO" 5 - fi +fi - ar_max_valid=$(echo $ar_valid | ${SED} -e 's/.* //g;' ) - GPU_MAX_ARCH=$ar_max_valid +ac_fn_cxx_check_header_compile "$LINENO" "netdb.h" "ac_cv_header_netdb_h" "$ac_includes_default" +if test "x$ac_cv_header_netdb_h" = xyes +then : + printf "%s\n" "#define HAVE_NETDB_H 1" >>confdefs.h +fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Pascal-style CUDA managed memory" >&5 -printf %s "checking for Pascal-style CUDA managed memory... " >&6; } - cm_invalid=$( echo $GPU_ARCHS | ${SED} -e 's/\b[1-5][0-9]\b/PRE/g;' ) - if ! echo $cm_invalid | ${GREP} -q PRE; then - GPU_PASCAL_MANAGEDMEM=1 +ac_fn_cxx_check_header_compile "$LINENO" "netinet/in.h" "ac_cv_header_netinet_in_h" "$ac_includes_default" +if test "x$ac_cv_header_netinet_in_h" = xyes +then : + printf "%s\n" "#define HAVE_NETINET_IN_H 1" >>confdefs.h - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } - else - GPU_PASCAL_MANAGEDMEM=0 +fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - fi - else - GPU_PASCAL_MANAGEDMEM=0 +ac_fn_cxx_check_header_compile "$LINENO" "sys/file.h" "ac_cv_header_sys_file_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_file_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_FILE_H 1" >>confdefs.h - fi +fi +ac_fn_cxx_check_header_compile "$LINENO" "sys/ioctl.h" "ac_cv_header_sys_ioctl_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_ioctl_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_IOCTL_H 1" >>confdefs.h +fi -# Check whether --with-shared_mem was given. -if test ${with_shared_mem+y} +ac_fn_cxx_check_header_compile "$LINENO" "sys/socket.h" "ac_cv_header_sys_socket_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_socket_h" = xyes then : - withval=$with_shared_mem; + printf "%s\n" "#define HAVE_SYS_SOCKET_H 1" >>confdefs.h + +fi + +ac_fn_cxx_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default" +if test "x$ac_cv_type__Bool" = xyes +then : + +printf "%s\n" "#define HAVE__BOOL 1" >>confdefs.h + + +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5 +printf %s "checking for stdbool.h that conforms to C99... " >&6; } +if test ${ac_cv_header_stdbool_h+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + + #ifndef __bool_true_false_are_defined + #error "__bool_true_false_are_defined is not defined" + #endif + char a[__bool_true_false_are_defined == 1 ? 1 : -1]; + + /* Regardless of whether this is C++ or "_Bool" is a + valid type name, "true" and "false" should be usable + in #if expressions and integer constant expressions, + and "bool" should be a valid type name. */ + + #if !true + #error "'true' is not true" + #endif + #if true != 1 + #error "'true' is not equal to 1" + #endif + char b[true == 1 ? 1 : -1]; + char c[true]; + + #if false + #error "'false' is not false" + #endif + #if false != 0 + #error "'false' is not equal to 0" + #endif + char d[false == 0 ? 1 : -1]; + + enum { e = false, f = true, g = false * true, h = true * 256 }; + + char i[(bool) 0.5 == true ? 1 : -1]; + char j[(bool) 0.0 == false ? 1 : -1]; + char k[sizeof (bool) > 0 ? 1 : -1]; + + struct sb { bool s: 1; bool t; } s; + char l[sizeof s.t > 0 ? 1 : -1]; + + /* The following fails for + HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ + bool m[h]; + char n[sizeof m == h * sizeof m[0] ? 1 : -1]; + char o[-1 - (bool) 0 < 0 ? 1 : -1]; + /* Catch a bug in an HP-UX C compiler. See + https://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html + https://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html + */ + bool p = true; + bool *pp = &p; + + /* C 1999 specifies that bool, true, and false are to be + macros, but C++ 2011 and later overrule this. */ + #if __cplusplus < 201103 + #ifndef bool + #error "bool is not defined" + #endif + #ifndef false + #error "false is not defined" + #endif + #ifndef true + #error "true is not defined" + #endif + #endif + + /* If _Bool is available, repeat with it all the tests + above that used bool. */ + #ifdef HAVE__BOOL + struct sB { _Bool s: 1; _Bool t; } t; + + char q[(_Bool) 0.5 == true ? 1 : -1]; + char r[(_Bool) 0.0 == false ? 1 : -1]; + char u[sizeof (_Bool) > 0 ? 1 : -1]; + char v[sizeof t.t > 0 ? 1 : -1]; + + _Bool w[h]; + char x[sizeof m == h * sizeof m[0] ? 1 : -1]; + char y[-1 - (_Bool) 0 < 0 ? 1 : -1]; + _Bool z = true; + _Bool *pz = &p; + #endif + +int +main (void) +{ + + bool ps = &s; + *pp |= p; + *pp |= ! p; + + #ifdef HAVE__BOOL + _Bool pt = &t; + *pz |= z; + *pz |= ! z; + #endif + + /* Refer to every declared value, so they cannot be + discarded as unused. */ + return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !j + !k + + !l + !m + !n + !o + !p + !pp + !ps + #ifdef HAVE__BOOL + + !q + !r + !u + !v + !w + !x + !y + !z + !pt + #endif + ); + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + ac_cv_header_stdbool_h=yes +else $as_nop + ac_cv_header_stdbool_h=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5 +printf "%s\n" "$ac_cv_header_stdbool_h" >&6; } + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5 +printf %s "checking for GNU libc compatible malloc... " >&6; } +if test ${ac_cv_func_malloc_0_nonnull+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test "$cross_compiling" = yes +then : + case "$host_os" in # (( + # Guess yes on platforms where we know the result. + *-gnu* | freebsd* | netbsd* | openbsd* | bitrig* \ + | hpux* | solaris* | cygwin* | mingw* | msys* ) + ac_cv_func_malloc_0_nonnull=yes ;; + # If we don't know, assume the worst. + *) ac_cv_func_malloc_0_nonnull=no ;; + esac +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +void *p = malloc (0); + int result = !p; + free (p); + return result; + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_run "$LINENO" +then : + ac_cv_func_malloc_0_nonnull=yes +else $as_nop + ac_cv_func_malloc_0_nonnull=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5 +printf "%s\n" "$ac_cv_func_malloc_0_nonnull" >&6; } +if test $ac_cv_func_malloc_0_nonnull = yes +then : + +printf "%s\n" "#define HAVE_MALLOC 1" >>confdefs.h + +else $as_nop + printf "%s\n" "#define HAVE_MALLOC 0" >>confdefs.h + + case " $LIBOBJS " in + *" malloc.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS malloc.$ac_objext" + ;; +esac + + +printf "%s\n" "#define malloc rpl_malloc" >>confdefs.h + +fi + + + +HAVE_OPENMP=0 + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for OpenMP flag of C++ compiler" >&5 +printf %s "checking for OpenMP flag of C++ compiler... " >&6; } +if test ${ax_cv_cxx_openmp+y} +then : + printf %s "(cached) " >&6 +else $as_nop + saveCXXFLAGS=$CXXFLAGS +ax_cv_cxx_openmp=unknown +# Flags to try: -fopenmp (gcc), -mp (SGI & PGI), +# -qopenmp (icc>=15), -openmp (icc), +# -xopenmp (Sun), -omp (Tru64), +# -qsmp=omp (AIX), +# none +ax_openmp_flags="-fopenmp -openmp -qopenmp -mp -xopenmp -omp -qsmp=omp none" +if test "x$OPENMP_CXXFLAGS" != x; then + ax_openmp_flags="$OPENMP_CXXFLAGS $ax_openmp_flags" +fi +for ax_openmp_flag in $ax_openmp_flags; do + case $ax_openmp_flag in + none) CXXFLAGS=$saveCXX ;; + *) CXXFLAGS="$saveCXXFLAGS $ax_openmp_flag" ;; + esac + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include + +static void +parallel_fill(int * data, int n) +{ + int i; +#pragma omp parallel for + for (i = 0; i < n; ++i) + data[i] = i; +} + +int +main() +{ + int arr[100000]; + omp_set_num_threads(2); + parallel_fill(arr, 100000); + return 0; +} + +_ACEOF +if ac_fn_cxx_try_link "$LINENO" +then : + ax_cv_cxx_openmp=$ax_openmp_flag; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +done +CXXFLAGS=$saveCXXFLAGS + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cxx_openmp" >&5 +printf "%s\n" "$ax_cv_cxx_openmp" >&6; } +if test "x$ax_cv_cxx_openmp" = "xunknown"; then + : +else + if test "x$ax_cv_cxx_openmp" != "xnone"; then + OPENMP_CXXFLAGS=$ax_cv_cxx_openmp + fi + +printf "%s\n" "#define HAVE_OPENMP 1" >>confdefs.h + +fi + +if test x$OPENMP_CXXFLAGS != x +then : + HAVE_OPENMP=1 + +fi +if test x$HAVE_OPENMP != x1 +then : + +else $as_nop + CXXFLAGS="$CXXFLAGS $OPENMP_CXXFLAGS" + LDFLAGS="$LDFLAGS $OPENMP_CXXFLAGS" +fi + +ac_fn_cxx_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default" +if test "x$ac_cv_type_ptrdiff_t" = xyes +then : + +printf "%s\n" "#define HAVE_PTRDIFF_T 1" >>confdefs.h + + +fi + +ac_fn_c_find_intX_t "$LINENO" "16" "ac_cv_c_int16_t" +case $ac_cv_c_int16_t in #( + no|yes) ;; #( + *) + +printf "%s\n" "#define int16_t $ac_cv_c_int16_t" >>confdefs.h +;; +esac + +ac_fn_c_find_intX_t "$LINENO" "32" "ac_cv_c_int32_t" +case $ac_cv_c_int32_t in #( + no|yes) ;; #( + *) + +printf "%s\n" "#define int32_t $ac_cv_c_int32_t" >>confdefs.h +;; +esac + +ac_fn_c_find_intX_t "$LINENO" "64" "ac_cv_c_int64_t" +case $ac_cv_c_int64_t in #( + no|yes) ;; #( + *) + +printf "%s\n" "#define int64_t $ac_cv_c_int64_t" >>confdefs.h +;; +esac + +ac_fn_c_find_intX_t "$LINENO" "8" "ac_cv_c_int8_t" +case $ac_cv_c_int8_t in #( + no|yes) ;; #( + *) + +printf "%s\n" "#define int8_t $ac_cv_c_int8_t" >>confdefs.h +;; +esac + + + ac_fn_cxx_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default +" +if test "x$ac_cv_type_pid_t" = xyes +then : + +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #if defined _WIN64 && !defined __CYGWIN__ + LLP64 + #endif + +int +main (void) +{ + + ; + return 0; +} + +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + ac_pid_type='int' +else $as_nop + ac_pid_type='__int64' +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + +printf "%s\n" "#define pid_t $ac_pid_type" >>confdefs.h + + +fi + + +ac_fn_cxx_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" +if test "x$ac_cv_type_size_t" = xyes +then : + +else $as_nop + +printf "%s\n" "#define size_t unsigned int" >>confdefs.h + +fi + +ac_fn_cxx_check_type "$LINENO" "ssize_t" "ac_cv_type_ssize_t" "$ac_includes_default" +if test "x$ac_cv_type_ssize_t" = xyes +then : + +else $as_nop + +printf "%s\n" "#define ssize_t int" >>confdefs.h + +fi + +ac_fn_c_find_uintX_t "$LINENO" "16" "ac_cv_c_uint16_t" +case $ac_cv_c_uint16_t in #( + no|yes) ;; #( + *) + + +printf "%s\n" "#define uint16_t $ac_cv_c_uint16_t" >>confdefs.h +;; + esac + +ac_fn_c_find_uintX_t "$LINENO" "32" "ac_cv_c_uint32_t" +case $ac_cv_c_uint32_t in #( + no|yes) ;; #( + *) + +printf "%s\n" "#define _UINT32_T 1" >>confdefs.h + + +printf "%s\n" "#define uint32_t $ac_cv_c_uint32_t" >>confdefs.h +;; + esac + +ac_fn_c_find_uintX_t "$LINENO" "64" "ac_cv_c_uint64_t" +case $ac_cv_c_uint64_t in #( + no|yes) ;; #( + *) + +printf "%s\n" "#define _UINT64_T 1" >>confdefs.h + + +printf "%s\n" "#define uint64_t $ac_cv_c_uint64_t" >>confdefs.h +;; + esac + +ac_fn_c_find_uintX_t "$LINENO" "8" "ac_cv_c_uint8_t" +case $ac_cv_c_uint8_t in #( + no|yes) ;; #( + *) + +printf "%s\n" "#define _UINT8_T 1" >>confdefs.h + + +printf "%s\n" "#define uint8_t $ac_cv_c_uint8_t" >>confdefs.h +;; + esac + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for long double with more range or precision than double" >&5 +printf %s "checking for long double with more range or precision than double... " >&6; } +if test ${ac_cv_type_long_double_wider+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + long double const a[] = + { + 0.0L, DBL_MIN, DBL_MAX, DBL_EPSILON, + LDBL_MIN, LDBL_MAX, LDBL_EPSILON + }; + long double + f (long double x) + { + return ((x + (unsigned long int) 10) * (-1 / x) + a[0] + + (x ? f (x) : 'c')); + } + +int +main (void) +{ +static int test_array [1 - 2 * !((0 < ((DBL_MAX_EXP < LDBL_MAX_EXP) + + (DBL_MANT_DIG < LDBL_MANT_DIG) + - (LDBL_MAX_EXP < DBL_MAX_EXP) + - (LDBL_MANT_DIG < DBL_MANT_DIG))) + && (int) LDBL_EPSILON == 0 + )]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + ac_cv_type_long_double_wider=yes +else $as_nop + ac_cv_type_long_double_wider=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_double_wider" >&5 +printf "%s\n" "$ac_cv_type_long_double_wider" >&6; } + if test $ac_cv_type_long_double_wider = yes; then + +printf "%s\n" "#define HAVE_LONG_DOUBLE_WIDER 1" >>confdefs.h + + fi + +HAVE_FLOAT128=0 + +if test x$HAVE_HAVE_LONG_DOUBLE_WIDER = x1 +then : + HAVE_FLOAT128=0 + +fi + +# +# NUMA +# + +# Check whether --enable-numa was given. +if test ${enable_numa+y} +then : + enableval=$enable_numa; enable_numa=no +else $as_nop + enable_numa=yes +fi + +HAVE_NUMA=0 + +if test x$enable_numa != xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for numa_node_of_cpu in -lnuma" >&5 +printf %s "checking for numa_node_of_cpu in -lnuma... " >&6; } +if test ${ac_cv_lib_numa_numa_node_of_cpu+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lnuma $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +namespace conftest { + extern "C" int numa_node_of_cpu (); +} +int +main (void) +{ +return conftest::numa_node_of_cpu (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO" +then : + ac_cv_lib_numa_numa_node_of_cpu=yes +else $as_nop + ac_cv_lib_numa_numa_node_of_cpu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_numa_numa_node_of_cpu" >&5 +printf "%s\n" "$ac_cv_lib_numa_numa_node_of_cpu" >&6; } +if test "x$ac_cv_lib_numa_numa_node_of_cpu" = xyes +then : + HAVE_NUMA=1 + + LIBS="$LIBS -lnuma" +fi + +fi + +# +# HWLOC +# + +# Check whether --enable-hwloc was given. +if test ${enable_hwloc+y} +then : + enableval=$enable_hwloc; enable_hwloc=no +else $as_nop + enable_hwloc=yes +fi + +HAVE_HWLOC=0 + +if test x$enable_hwloc != xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for hwloc_topology_init in -lhwloc" >&5 +printf %s "checking for hwloc_topology_init in -lhwloc... " >&6; } +if test ${ac_cv_lib_hwloc_hwloc_topology_init+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lhwloc $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +namespace conftest { + extern "C" int hwloc_topology_init (); +} +int +main (void) +{ +return conftest::hwloc_topology_init (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO" +then : + ac_cv_lib_hwloc_hwloc_topology_init=yes +else $as_nop + ac_cv_lib_hwloc_hwloc_topology_init=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hwloc_hwloc_topology_init" >&5 +printf "%s\n" "$ac_cv_lib_hwloc_hwloc_topology_init" >&6; } +if test "x$ac_cv_lib_hwloc_hwloc_topology_init" = xyes +then : + HAVE_HWLOC=1 + + LIBS="$LIBS -lhwloc" +fi + +fi + +# +# VMA +# + +# Check whether --enable-vma was given. +if test ${enable_vma+y} +then : + enableval=$enable_vma; enable_vma=yes +else $as_nop + enable_vma=no +fi + +HAVE_VMA=0 + +if test x$enable_vma != xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for recvfrom_zcopy in -lvma" >&5 +printf %s "checking for recvfrom_zcopy in -lvma... " >&6; } +if test ${ac_cv_lib_vma_recvfrom_zcopy+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lvma $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +namespace conftest { + extern "C" int recvfrom_zcopy (); +} +int +main (void) +{ +return conftest::recvfrom_zcopy (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO" +then : + ac_cv_lib_vma_recvfrom_zcopy=yes +else $as_nop + ac_cv_lib_vma_recvfrom_zcopy=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_vma_recvfrom_zcopy" >&5 +printf "%s\n" "$ac_cv_lib_vma_recvfrom_zcopy" >&6; } +if test "x$ac_cv_lib_vma_recvfrom_zcopy" = xyes +then : + HAVE_VMA=1 + + LIBS="$LIBS -lvma" +fi + +fi + +# +# CUDA +# + +################################# +# NOTE # +# This needs to come after all # +# other compiler/library tests # +# since it changes LIB to # +# include CUDA-specific entries # +################################# + + + + +# Check whether --with-cuda_home was given. +if test ${with_cuda_home+y} +then : + withval=$with_cuda_home; +else $as_nop + with_cuda_home=/usr/local/cuda +fi + + CUDA_HOME=$with_cuda_home + + + # Check whether --enable-cuda was given. +if test ${enable_cuda+y} +then : + enableval=$enable_cuda; enable_cuda=no +else $as_nop + enable_cuda=yes +fi + + + HAVE_CUDA=0 + + CUDA_VERSION=0 + + GPU_MAX_ARCH=0 + + if test "$enable_cuda" != "no"; then + HAVE_CUDA=1 + + + # Extract the first word of "nvcc", so it can be a program name with args. +set dummy nvcc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_NVCC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $NVCC in + [\\/]* | ?:[\\/]*) + ac_cv_path_NVCC="$NVCC" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$CUDA_HOME/bin:$PATH" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_NVCC="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_NVCC" && ac_cv_path_NVCC="no" + ;; +esac +fi +NVCC=$ac_cv_path_NVCC +if test -n "$NVCC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $NVCC" >&5 +printf "%s\n" "$NVCC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + # Extract the first word of "nvprune", so it can be a program name with args. +set dummy nvprune; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_NVPRUNE+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $NVPRUNE in + [\\/]* | ?:[\\/]*) + ac_cv_path_NVPRUNE="$NVPRUNE" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$CUDA_HOME/bin:$PATH" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_NVPRUNE="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_NVPRUNE" && ac_cv_path_NVPRUNE="no" + ;; +esac +fi +NVPRUNE=$ac_cv_path_NVPRUNE +if test -n "$NVPRUNE"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $NVPRUNE" >&5 +printf "%s\n" "$NVPRUNE" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + # Extract the first word of "cuobjdump", so it can be a program name with args. +set dummy cuobjdump; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_CUOBJDUMP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $CUOBJDUMP in + [\\/]* | ?:[\\/]*) + ac_cv_path_CUOBJDUMP="$CUOBJDUMP" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$CUDA_HOME/bin:$PATH" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_CUOBJDUMP="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_CUOBJDUMP" && ac_cv_path_CUOBJDUMP="no" + ;; +esac +fi +CUOBJDUMP=$ac_cv_path_CUOBJDUMP +if test -n "$CUOBJDUMP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CUOBJDUMP" >&5 +printf "%s\n" "$CUOBJDUMP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + fi + + if test "$HAVE_CUDA" = "1"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a working CUDA installation" >&5 +printf %s "checking for a working CUDA installation... " >&6; } + + CXXFLAGS_save="$CXXFLAGS" + LDFLAGS_save="$LDFLAGS" + LIBS_save="$LIBS" + + ac_compile='$NVCC -c $NVCCFLAGS conftest.$ac_ext >&5' + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + + #include + #include +int +main (void) +{ +cudaMalloc(0, 0); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + +else $as_nop + HAVE_CUDA=0 + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + if test "$HAVE_CUDA" = "1"; then + LDFLAGS="-L$CUDA_HOME/lib64 -L$CUDA_HOME/lib" + LIBS="$LIBS -lcuda -lcudart" + + ac_link='$NVCC -o conftest$ac_exeext $NVCCFLAGS $LDFLAGS $LIBS conftest.$ac_ext >&5' + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + + #include + #include +int +main (void) +{ +cudaMalloc(0, 0); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO" +then : + CUDA_VERSION=$( ${NVCC} --version | ${GREP} -Po -e "release.*," | cut -d, -f1 | cut -d\ -f2 ) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes - v$CUDA_VERSION" >&5 +printf "%s\n" "yes - v$CUDA_VERSION" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + HAVE_CUDA=0 + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + HAVE_CUDA=0 + + fi + + CXXFLAGS="$CXXFLAGS_save" + LDFLAGS="$LDFLAGS_save" + LIBS="$LIBS_save" + fi + + +# Check whether --with-nvcc_flags was given. +if test ${with_nvcc_flags+y} +then : + withval=$with_nvcc_flags; +else $as_nop + with_nvcc_flags='-O3 -Xcompiler "-Wall"' +fi + + NVCCFLAGS=$with_nvcc_flags + + + if test "$HAVE_CUDA" = "1"; then + CPPFLAGS="$CPPFLAGS -DBF_CUDA_ENABLED=1" + CXXFLAGS="$CXXFLAGS -DBF_CUDA_ENABLED=1" + NVCCFLAGS="$NVCCFLAGS -DBF_CUDA_ENABLED=1" + LDFLAGS="$LDFLAGS -L$CUDA_HOME/lib64 -L$CUDA_HOME/lib" + LIBS="$LIBS -lcuda -lcudart -lnvrtc -lcublas -lcudadevrt -L. -lcufft_static_pruned -lculibos -lnvToolsExt" + fi + + +# Check whether --with-gpu_archs was given. +if test ${with_gpu_archs+y} +then : + withval=$with_gpu_archs; +else $as_nop + with_gpu_archs='auto' +fi + + if test "$HAVE_CUDA" = "1"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for valid CUDA architectures" >&5 +printf %s "checking for valid CUDA architectures... " >&6; } + ar_supported=$( ${NVCC} -h | ${GREP} -Po "'compute_[0-9]{2,3}" | cut -d_ -f2 | sort | uniq ) + ar_supported_flat=$( echo $ar_supported | xargs ) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: found: $ar_supported_flat" >&5 +printf "%s\n" "found: $ar_supported_flat" >&6; } + + if test "$with_gpu_archs" = "auto"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking which CUDA architectures to target" >&5 +printf %s "checking which CUDA architectures to target... " >&6; } + + CXXFLAGS_save="$CXXFLAGS" + LDFLAGS_save="$LDFLAGS" + LIBS_save="$LIBS" + + LDFLAGS="-L$CUDA_HOME/lib64 -L$CUDA_HOME/lib" + LIBS="-lcuda -lcudart" + ac_run='$NVCC -o conftest$ac_ext $LDFLAGS $LIBS conftest.$ac_ext>&5' + if test "$cross_compiling" = yes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + + #include + #include + #include + #include + #include +int +main (void) +{ + + std::set archs; + int major, minor, arch; + int deviceCount = 0; + cudaGetDeviceCount(&deviceCount); + if( deviceCount == 0 ) { + return 1; + } + std::ofstream fh; + fh.open("confarchs.out"); + for(int dev=0; dev 0 ) { + fh << " "; + } + fh << arch; + } + arch += minor; + if( archs.count(arch) == 0 ) { + archs.insert(arch); + fh << " " << arch; + } + } + fh.close(); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_run "$LINENO" +then : + GPU_ARCHS=`cat confarchs.out` + + ar_supported=$( ${NVCC} -h | ${GREP} -Po "'compute_[0-9]{2,3}" | cut -d_ -f2 | sort | uniq ) + ar_valid=$( echo $GPU_ARCHS $ar_supported | xargs -n1 | sort | uniq -d | xargs ) + if test "$ar_valid" = ""; then + as_fn_error $? "failed to find any supported" "$LINENO" 5 + else + GPU_ARCHS=$ar_valid + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $GPU_ARCHS" >&5 +printf "%s\n" "$GPU_ARCHS" >&6; } + fi +else $as_nop + as_fn_error $? "failed to find any" "$LINENO" 5 +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + + CXXFLAGS="$CXXFLAGS_save" + LDFLAGS="$LDFLAGS_save" + LIBS="$LIBS_save" + else + GPU_ARCHS=$with_gpu_archs + + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for valid requested CUDA architectures" >&5 +printf %s "checking for valid requested CUDA architectures... " >&6; } + ar_requested=$( echo "$GPU_ARCHS" | wc -w ) + ar_valid=$( echo $GPU_ARCHS $ar_supported | xargs -n1 | sort | uniq -d | xargs ) + ar_found=$( echo $ar_valid | wc -w ) + if test "$ar_requested" = "$ar_found"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + else + as_fn_error $? "only '$ar_valid' are supported" "$LINENO" 5 + fi + + ar_max_valid=$(echo $ar_valid | ${SED} -e 's/.* //g;' ) + GPU_MAX_ARCH=$ar_max_valid + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Pascal-style CUDA managed memory" >&5 +printf %s "checking for Pascal-style CUDA managed memory... " >&6; } + cm_invalid=$( echo $GPU_ARCHS | ${SED} -e 's/\b[1-5][0-9]\b/PRE/g;' ) + if ! echo $cm_invalid | ${GREP} -q PRE; then + GPU_PASCAL_MANAGEDMEM=1 + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + else + GPU_PASCAL_MANAGEDMEM=0 + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + fi + else + GPU_PASCAL_MANAGEDMEM=0 + + fi + + + +# Check whether --with-shared_mem was given. +if test ${with_shared_mem+y} +then : + withval=$with_shared_mem; +else $as_nop + with_shared_mem=16384 +fi + +GPU_SHAREDMEM=$with_shared_mem + +if test x$HAVE_CUDA = x0 +then : + GPU_SHAREDMEM=0 + +fi + +# +# Bifrost memory alignment +# + + +# Check whether --with-alignment was given. +if test ${with_alignment+y} +then : + withval=$with_alignment; +else $as_nop + with_alignment=4096 +fi + +ALIGNMENT=$with_alignment + + +# +# Bifrost proclog location +# + + + + + +# Check whether --with-logging_dir was given. +if test ${with_logging_dir+y} +then : + withval=$with_logging_dir; HAVE_TMPFS=$with_logging_dir + +else $as_nop + HAVE_TMPFS=/tmp + +fi + + + if test "$HAVE_TMPFS" = "/tmp"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for /dev/shm" >&5 +printf %s "checking for /dev/shm... " >&6; } +if test ${ac_cv_file__dev_shm+y} +then : + printf %s "(cached) " >&6 +else $as_nop + test "$cross_compiling" = yes && + as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 +if test -r "/dev/shm"; then + ac_cv_file__dev_shm=yes +else + ac_cv_file__dev_shm=no +fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__dev_shm" >&5 +printf "%s\n" "$ac_cv_file__dev_shm" >&6; } +if test "x$ac_cv_file__dev_shm" = xyes +then : + HAVE_TMPFS=/dev/shm/bifrost + +fi + + fi + + if test "$HAVE_TMPFS" = "/tmp"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for /Volumes/RAMDisk" >&5 +printf %s "checking for /Volumes/RAMDisk... " >&6; } +if test ${ac_cv_file__Volumes_RAMDisk+y} +then : + printf %s "(cached) " >&6 +else $as_nop + test "$cross_compiling" = yes && + as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 +if test -r "/Volumes/RAMDisk"; then + ac_cv_file__Volumes_RAMDisk=yes +else + ac_cv_file__Volumes_RAMDisk=no +fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__Volumes_RAMDisk" >&5 +printf "%s\n" "$ac_cv_file__Volumes_RAMDisk" >&6; } +if test "x$ac_cv_file__Volumes_RAMDisk" = xyes +then : + HAVE_TMPFS=/Volumes/RAMDisk/bifrost + +fi + + fi + + if test "$HAVE_TMPFS" = "/tmp"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for /tmp" >&5 +printf %s "checking for /tmp... " >&6; } +if test ${ac_cv_file__tmp+y} +then : + printf %s "(cached) " >&6 +else $as_nop + test "$cross_compiling" = yes && + as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 +if test -r "/tmp"; then + ac_cv_file__tmp=yes +else + ac_cv_file__tmp=no +fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__tmp" >&5 +printf "%s\n" "$ac_cv_file__tmp" >&6; } +if test "x$ac_cv_file__tmp" = xyes +then : + HAVE_TMPFS=/tmp + +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $HAVE_TMPFS may have performance problems for logging" >&5 +printf "%s\n" "$as_me: WARNING: $HAVE_TMPFS may have performance problems for logging" >&2;} + HAVE_TMPFS=/tmp/bifrost + + fi + + +# +# Bifrost Features +# + +# Check whether --enable-debug was given. +if test ${enable_debug+y} +then : + enableval=$enable_debug; enable_debug=yes +else $as_nop + enable_debug=no +fi + +HAVE_DEBUG=0 + +if test x$enable_debug != xno +then : + HAVE_DEBUG=1 + + CXXFLAGS="$CXXFLAGS -g" + NVCCFLAGS="$NVCCFLAGS -g" +fi + +# Check whether --enable-trace was given. +if test ${enable_trace+y} +then : + enableval=$enable_trace; enable_trace=yes +else $as_nop + enable_trace=no +fi + +HAVE_TRACE=0 + +if test x$enable_trace != xno +then : + HAVE_TRACE=1 + +fi + + + + # Check whether --enable-native_arch was given. +if test ${enable_native_arch+y} +then : + enableval=$enable_native_arch; enable_native_arch=no +else $as_nop + enable_native_arch=yes +fi + + + if test "$enable_native_arch" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the compiler accepts '-march=native'" >&5 +printf %s "checking if the compiler accepts '-march=native'... " >&6; } + + CXXFLAGS_temp="$CXXFLAGS -march=native" + + ac_compile='$CXX -c $CXXFLAGS_temp conftest.$ac_ext >&5' + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + + +int +main (void) +{ + + int i = 5; + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + CXXFLAGS="$CXXFLAGS -march=native" + NVCCFLAGS="$NVCCFLAGS -Xcompiler \"-march=native\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else $as_nop + enable_native_arch=no + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + fi + + +# Check whether --enable-cuda_debug was given. +if test ${enable_cuda_debug+y} +then : + enableval=$enable_cuda_debug; enable_cuda_debug=yes +else $as_nop + enable_cuda_debug=no +fi + +HAVE_CUDA_DEBUG=0 + +if test x$enable_cuda_debug != xno +then : + HAVE_CUDA_DEBUG=1 + + NVCCFLAGS="$NVCCFLAGS -G" +fi + + + +# Check whether --with-mapped_ring_dir was given. +if test ${with_mapped_ring_dir+y} +then : + withval=$with_mapped_ring_dir; +else $as_nop + mapped_ring_dir=/tmp/bifrost +fi + +CPPFLAGS="$CPPFLAGS -DBF_MAPPED_RING_DIR=\"$mapped_ring_dir\"" + +# +# Python +# + +# Check whether --enable-python was given. +if test ${enable_python+y} +then : + enableval=$enable_python; enable_python=no +else $as_nop + enable_python=yes +fi + +HAVE_PYTHON=0 + +if test x$enable_python != xno +then : + + + + + + + + + + + if test -z "$PYTHON" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether python executable path has been provided" >&5 +printf %s "checking whether python executable path has been provided... " >&6; } + +# Check whether --with-python was given. +if test ${with_python+y} +then : + withval=$with_python; + if test "$withval" != yes && test "$withval" != no +then : + + PYTHON="$withval" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5 +printf "%s\n" "$PYTHON" >&6; } + +else $as_nop + + PYTHON="" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + if test "$withval" != no +then : + + # Extract the first word of "python", so it can be a program name with args. +set dummy python; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_PYTHON+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $PYTHON in + [\\/]* | ?:[\\/]*) + ac_cv_path_PYTHON="$PYTHON" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_PYTHON="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_PYTHON" && ac_cv_path_PYTHON="no" + ;; +esac +fi +PYTHON=$ac_cv_path_PYTHON +if test -n "$PYTHON"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5 +printf "%s\n" "$PYTHON" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + +fi + +fi + +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + # Extract the first word of "python", so it can be a program name with args. +set dummy python; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_PYTHON+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $PYTHON in + [\\/]* | ?:[\\/]*) + ac_cv_path_PYTHON="$PYTHON" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_PYTHON="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_PYTHON" && ac_cv_path_PYTHON="no" + ;; +esac +fi +PYTHON=$ac_cv_path_PYTHON +if test -n "$PYTHON"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5 +printf "%s\n" "$PYTHON" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + +fi + + +fi + + + + + + + if test x${PYTHON} != xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $PYTHON as ctypesgen" >&5 +printf %s "checking whether $PYTHON as ctypesgen... " >&6; } + if ! ${PYTHON} -c "import ctypesgen" 2>/dev/null +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: python module will not be built" >&5 +printf "%s\n" "$as_me: WARNING: python module will not be built" >&2;} +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + HAVE_PYTHON=1 + +fi +fi +fi + +# Check whether --with-pybuild_flags was given. +if test ${with_pybuild_flags+y} +then : + withval=$with_pybuild_flags; +fi + +PYBUILDFLAGS=$with_pybuild_flags + + + +# Check whether --with-pyinstall_flags was given. +if test ${with_pyinstall_flags+y} +then : + withval=$with_pyinstall_flags; +fi + +PYINSTALLFLAGS=$with_pyinstall_flags + + +# +# Docker +# + + + + + + + + + + + + if test -z "$DOCKER" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether docker executable path has been provided" >&5 +printf %s "checking whether docker executable path has been provided... " >&6; } + +# Check whether --with-docker was given. +if test ${with_docker+y} +then : + withval=$with_docker; + if test "$withval" != yes && test "$withval" != no +then : + + DOCKER="$withval" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DOCKER" >&5 +printf "%s\n" "$DOCKER" >&6; } + +else $as_nop + + DOCKER="" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + if test "$withval" != no +then : + + # Extract the first word of "docker", so it can be a program name with args. +set dummy docker; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_DOCKER+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $DOCKER in + [\\/]* | ?:[\\/]*) + ac_cv_path_DOCKER="$DOCKER" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_DOCKER="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_DOCKER" && ac_cv_path_DOCKER="no" + ;; +esac +fi +DOCKER=$ac_cv_path_DOCKER +if test -n "$DOCKER"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DOCKER" >&5 +printf "%s\n" "$DOCKER" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + +fi + +fi + +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + # Extract the first word of "docker", so it can be a program name with args. +set dummy docker; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_DOCKER+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $DOCKER in + [\\/]* | ?:[\\/]*) + ac_cv_path_DOCKER="$DOCKER" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_DOCKER="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_DOCKER" && ac_cv_path_DOCKER="no" + ;; +esac +fi +DOCKER=$ac_cv_path_DOCKER +if test -n "$DOCKER"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DOCKER" >&5 +printf "%s\n" "$DOCKER" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + +fi + + +fi + + + + + + +if test x${DOCKER} != xno +then : + HAVE_DOCKER=1 + +fi + +# +# Documentation +# + + + + + + + + + + + + +# Files: +DX_PROJECT=bifrost + +DX_CONFIG='$(srcdir)/Doxyfile' + +DX_DOCDIR='doxygen-doc' + + +# Environment variables used inside doxygen.cfg: +DX_ENV="$DX_ENV SRCDIR='$srcdir'" +SRCDIR=$srcdir + +DX_ENV="$DX_ENV PROJECT='$DX_PROJECT'" +PROJECT=$DX_PROJECT + +DX_ENV="$DX_ENV VERSION='$PACKAGE_VERSION'" + + +# Doxygen itself: + + + + # Check whether --enable-doxygen-doc was given. +if test ${enable_doxygen_doc+y} +then : + enableval=$enable_doxygen_doc; +case "$enableval" in +#( +y|Y|yes|Yes|YES) + DX_FLAG_doc=1 + + +;; #( +n|N|no|No|NO) + DX_FLAG_doc=0 + +;; #( +*) + as_fn_error $? "invalid value '$enableval' given to doxygen-doc" "$LINENO" 5 +;; +esac + +else $as_nop + +DX_FLAG_doc=1 + + + +fi + +if test "$DX_FLAG_doc" = 1; then + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}doxygen", so it can be a program name with args. +set dummy ${ac_tool_prefix}doxygen; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_DX_DOXYGEN+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $DX_DOXYGEN in + [\\/]* | ?:[\\/]*) + ac_cv_path_DX_DOXYGEN="$DX_DOXYGEN" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_DX_DOXYGEN="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +DX_DOXYGEN=$ac_cv_path_DX_DOXYGEN +if test -n "$DX_DOXYGEN"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DX_DOXYGEN" >&5 +printf "%s\n" "$DX_DOXYGEN" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_path_DX_DOXYGEN"; then + ac_pt_DX_DOXYGEN=$DX_DOXYGEN + # Extract the first word of "doxygen", so it can be a program name with args. +set dummy doxygen; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_DX_DOXYGEN+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $ac_pt_DX_DOXYGEN in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_DX_DOXYGEN="$ac_pt_DX_DOXYGEN" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_DX_DOXYGEN="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +ac_pt_DX_DOXYGEN=$ac_cv_path_ac_pt_DX_DOXYGEN +if test -n "$ac_pt_DX_DOXYGEN"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_DOXYGEN" >&5 +printf "%s\n" "$ac_pt_DX_DOXYGEN" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_pt_DX_DOXYGEN" = x; then + DX_DOXYGEN="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DX_DOXYGEN=$ac_pt_DX_DOXYGEN + fi +else + DX_DOXYGEN="$ac_cv_path_DX_DOXYGEN" +fi + +if test "$DX_FLAG_doc$DX_DOXYGEN" = 1; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: doxygen not found - will not generate any doxygen documentation" >&5 +printf "%s\n" "$as_me: WARNING: doxygen not found - will not generate any doxygen documentation" >&2;} + DX_FLAG_doc=0 + +fi + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}perl", so it can be a program name with args. +set dummy ${ac_tool_prefix}perl; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_DX_PERL+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $DX_PERL in + [\\/]* | ?:[\\/]*) + ac_cv_path_DX_PERL="$DX_PERL" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_DX_PERL="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +DX_PERL=$ac_cv_path_DX_PERL +if test -n "$DX_PERL"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DX_PERL" >&5 +printf "%s\n" "$DX_PERL" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_path_DX_PERL"; then + ac_pt_DX_PERL=$DX_PERL + # Extract the first word of "perl", so it can be a program name with args. +set dummy perl; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_DX_PERL+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $ac_pt_DX_PERL in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_DX_PERL="$ac_pt_DX_PERL" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_DX_PERL="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +ac_pt_DX_PERL=$ac_cv_path_ac_pt_DX_PERL +if test -n "$ac_pt_DX_PERL"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_PERL" >&5 +printf "%s\n" "$ac_pt_DX_PERL" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_pt_DX_PERL" = x; then + DX_PERL="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DX_PERL=$ac_pt_DX_PERL + fi +else + DX_PERL="$ac_cv_path_DX_PERL" +fi + +if test "$DX_FLAG_doc$DX_PERL" = 1; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: perl not found - will not generate any doxygen documentation" >&5 +printf "%s\n" "$as_me: WARNING: perl not found - will not generate any doxygen documentation" >&2;} + DX_FLAG_doc=0 + +fi + + : +fi +if test "$DX_FLAG_doc" = 1; then + DX_ENV="$DX_ENV PERL_PATH='$DX_PERL'" +PERL_PATH=$DX_PERL + + : +else + + : +fi + + +# Dot for graphics: + + + + # Check whether --enable-doxygen-dot was given. +if test ${enable_doxygen_dot+y} +then : + enableval=$enable_doxygen_dot; +case "$enableval" in +#( +y|Y|yes|Yes|YES) + DX_FLAG_dot=1 + + +test "$DX_FLAG_doc" = "1" \ +|| as_fn_error $? "doxygen-dot requires doxygen-doc" "$LINENO" 5 + +;; #( +n|N|no|No|NO) + DX_FLAG_dot=0 + +;; #( +*) + as_fn_error $? "invalid value '$enableval' given to doxygen-dot" "$LINENO" 5 +;; +esac + +else $as_nop + +DX_FLAG_dot=0 + + +test "$DX_FLAG_doc" = "1" || DX_FLAG_dot=0 + + + +fi + +if test "$DX_FLAG_dot" = 1; then + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dot", so it can be a program name with args. +set dummy ${ac_tool_prefix}dot; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_DX_DOT+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $DX_DOT in + [\\/]* | ?:[\\/]*) + ac_cv_path_DX_DOT="$DX_DOT" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_DX_DOT="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +DX_DOT=$ac_cv_path_DX_DOT +if test -n "$DX_DOT"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DX_DOT" >&5 +printf "%s\n" "$DX_DOT" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_path_DX_DOT"; then + ac_pt_DX_DOT=$DX_DOT + # Extract the first word of "dot", so it can be a program name with args. +set dummy dot; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_DX_DOT+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $ac_pt_DX_DOT in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_DX_DOT="$ac_pt_DX_DOT" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_DX_DOT="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +ac_pt_DX_DOT=$ac_cv_path_ac_pt_DX_DOT +if test -n "$ac_pt_DX_DOT"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_DOT" >&5 +printf "%s\n" "$ac_pt_DX_DOT" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_pt_DX_DOT" = x; then + DX_DOT="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DX_DOT=$ac_pt_DX_DOT + fi +else + DX_DOT="$ac_cv_path_DX_DOT" +fi + +if test "$DX_FLAG_dot$DX_DOT" = 1; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: dot not found - will not generate graphics for doxygen documentation" >&5 +printf "%s\n" "$as_me: WARNING: dot not found - will not generate graphics for doxygen documentation" >&2;} + DX_FLAG_dot=0 + +fi + + : +fi +if test "$DX_FLAG_dot" = 1; then + DX_ENV="$DX_ENV HAVE_DOT='YES'" +HAVE_DOT=YES + + DX_ENV="$DX_ENV DOT_PATH='`expr ".$DX_DOT" : '\(\.\)[^/]*$' \| "x$DX_DOT" : 'x\(.*\)/[^/]*$'`'" +DOT_PATH=`expr ".$DX_DOT" : '\(\.\)[^/]*$' \| "x$DX_DOT" : 'x\(.*\)/[^/]*$'` + + : +else + DX_ENV="$DX_ENV HAVE_DOT='NO'" +HAVE_DOT=NO + + : +fi + + +# Man pages generation: + + + + # Check whether --enable-doxygen-man was given. +if test ${enable_doxygen_man+y} +then : + enableval=$enable_doxygen_man; +case "$enableval" in +#( +y|Y|yes|Yes|YES) + DX_FLAG_man=1 + + +test "$DX_FLAG_doc" = "1" \ +|| as_fn_error $? "doxygen-man requires doxygen-doc" "$LINENO" 5 + +;; #( +n|N|no|No|NO) + DX_FLAG_man=0 + +;; #( +*) + as_fn_error $? "invalid value '$enableval' given to doxygen-man" "$LINENO" 5 +;; +esac + +else $as_nop + +DX_FLAG_man=1 + + +test "$DX_FLAG_doc" = "1" || DX_FLAG_man=0 + + + +fi + +if test "$DX_FLAG_man" = 1; then + + : +fi +if test "$DX_FLAG_man" = 1; then + DX_ENV="$DX_ENV GENERATE_MAN='YES'" +GENERATE_MAN=YES + + : +else + DX_ENV="$DX_ENV GENERATE_MAN='NO'" +GENERATE_MAN=NO + + : +fi + + +# RTF file generation: + + + + # Check whether --enable-doxygen-rtf was given. +if test ${enable_doxygen_rtf+y} +then : + enableval=$enable_doxygen_rtf; +case "$enableval" in +#( +y|Y|yes|Yes|YES) + DX_FLAG_rtf=1 + + +test "$DX_FLAG_doc" = "1" \ +|| as_fn_error $? "doxygen-rtf requires doxygen-doc" "$LINENO" 5 + +;; #( +n|N|no|No|NO) + DX_FLAG_rtf=0 + +;; #( +*) + as_fn_error $? "invalid value '$enableval' given to doxygen-rtf" "$LINENO" 5 +;; +esac + +else $as_nop + +DX_FLAG_rtf=0 + + +test "$DX_FLAG_doc" = "1" || DX_FLAG_rtf=0 + + + +fi + +if test "$DX_FLAG_rtf" = 1; then + + : +fi +if test "$DX_FLAG_rtf" = 1; then + DX_ENV="$DX_ENV GENERATE_RTF='YES'" +GENERATE_RTF=YES + + : +else + DX_ENV="$DX_ENV GENERATE_RTF='NO'" +GENERATE_RTF=NO + + : +fi + + +# XML file generation: + + + + # Check whether --enable-doxygen-xml was given. +if test ${enable_doxygen_xml+y} +then : + enableval=$enable_doxygen_xml; +case "$enableval" in +#( +y|Y|yes|Yes|YES) + DX_FLAG_xml=1 + + +test "$DX_FLAG_doc" = "1" \ +|| as_fn_error $? "doxygen-xml requires doxygen-doc" "$LINENO" 5 + +;; #( +n|N|no|No|NO) + DX_FLAG_xml=0 + +;; #( +*) + as_fn_error $? "invalid value '$enableval' given to doxygen-xml" "$LINENO" 5 +;; +esac + +else $as_nop + +DX_FLAG_xml=0 + + +test "$DX_FLAG_doc" = "1" || DX_FLAG_xml=0 + + + +fi + +if test "$DX_FLAG_xml" = 1; then + + : +fi +if test "$DX_FLAG_xml" = 1; then + DX_ENV="$DX_ENV GENERATE_XML='YES'" +GENERATE_XML=YES + + : +else + DX_ENV="$DX_ENV GENERATE_XML='NO'" +GENERATE_XML=NO + + : +fi + + +# (Compressed) HTML help generation: + + + + # Check whether --enable-doxygen-chm was given. +if test ${enable_doxygen_chm+y} +then : + enableval=$enable_doxygen_chm; +case "$enableval" in +#( +y|Y|yes|Yes|YES) + DX_FLAG_chm=1 + + +test "$DX_FLAG_doc" = "1" \ +|| as_fn_error $? "doxygen-chm requires doxygen-doc" "$LINENO" 5 + +;; #( +n|N|no|No|NO) + DX_FLAG_chm=0 + +;; #( +*) + as_fn_error $? "invalid value '$enableval' given to doxygen-chm" "$LINENO" 5 +;; +esac + +else $as_nop + +DX_FLAG_chm=0 + + +test "$DX_FLAG_doc" = "1" || DX_FLAG_chm=0 + + + +fi + +if test "$DX_FLAG_chm" = 1; then + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}hhc", so it can be a program name with args. +set dummy ${ac_tool_prefix}hhc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_DX_HHC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $DX_HHC in + [\\/]* | ?:[\\/]*) + ac_cv_path_DX_HHC="$DX_HHC" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_DX_HHC="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +DX_HHC=$ac_cv_path_DX_HHC +if test -n "$DX_HHC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DX_HHC" >&5 +printf "%s\n" "$DX_HHC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_path_DX_HHC"; then + ac_pt_DX_HHC=$DX_HHC + # Extract the first word of "hhc", so it can be a program name with args. +set dummy hhc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_DX_HHC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $ac_pt_DX_HHC in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_DX_HHC="$ac_pt_DX_HHC" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_DX_HHC="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +ac_pt_DX_HHC=$ac_cv_path_ac_pt_DX_HHC +if test -n "$ac_pt_DX_HHC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_HHC" >&5 +printf "%s\n" "$ac_pt_DX_HHC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_pt_DX_HHC" = x; then + DX_HHC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DX_HHC=$ac_pt_DX_HHC + fi +else + DX_HHC="$ac_cv_path_DX_HHC" +fi + +if test "$DX_FLAG_chm$DX_HHC" = 1; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: hhc not found - will not generate doxygen compressed HTML help documentation" >&5 +printf "%s\n" "$as_me: WARNING: hhc not found - will not generate doxygen compressed HTML help documentation" >&2;} + DX_FLAG_chm=0 + +fi + + : +fi +if test "$DX_FLAG_chm" = 1; then + DX_ENV="$DX_ENV HHC_PATH='$DX_HHC'" +HHC_PATH=$DX_HHC + + DX_ENV="$DX_ENV GENERATE_HTML='YES'" +GENERATE_HTML=YES + + DX_ENV="$DX_ENV GENERATE_HTMLHELP='YES'" +GENERATE_HTMLHELP=YES + + : +else + DX_ENV="$DX_ENV GENERATE_HTMLHELP='NO'" +GENERATE_HTMLHELP=NO + + : +fi + + +# Separate CHI file generation. + + + + # Check whether --enable-doxygen-chi was given. +if test ${enable_doxygen_chi+y} +then : + enableval=$enable_doxygen_chi; +case "$enableval" in +#( +y|Y|yes|Yes|YES) + DX_FLAG_chi=1 + + +test "$DX_FLAG_chm" = "1" \ +|| as_fn_error $? "doxygen-chi requires doxygen-chm" "$LINENO" 5 + +;; #( +n|N|no|No|NO) + DX_FLAG_chi=0 + +;; #( +*) + as_fn_error $? "invalid value '$enableval' given to doxygen-chi" "$LINENO" 5 +;; +esac + +else $as_nop + +DX_FLAG_chi=0 + + +test "$DX_FLAG_chm" = "1" || DX_FLAG_chi=0 + + + +fi + +if test "$DX_FLAG_chi" = 1; then + + : +fi +if test "$DX_FLAG_chi" = 1; then + DX_ENV="$DX_ENV GENERATE_CHI='YES'" +GENERATE_CHI=YES + + : +else + DX_ENV="$DX_ENV GENERATE_CHI='NO'" +GENERATE_CHI=NO + + : +fi + + +# Plain HTML pages generation: + + + + # Check whether --enable-doxygen-html was given. +if test ${enable_doxygen_html+y} +then : + enableval=$enable_doxygen_html; +case "$enableval" in +#( +y|Y|yes|Yes|YES) + DX_FLAG_html=1 + + +test "$DX_FLAG_doc" = "1" \ +|| as_fn_error $? "doxygen-html requires doxygen-doc" "$LINENO" 5 + +test "$DX_FLAG_chm" = "0" \ +|| as_fn_error $? "doxygen-html contradicts doxygen-chm" "$LINENO" 5 + +;; #( +n|N|no|No|NO) + DX_FLAG_html=0 + +;; #( +*) + as_fn_error $? "invalid value '$enableval' given to doxygen-html" "$LINENO" 5 +;; +esac + +else $as_nop + +DX_FLAG_html=1 + + +test "$DX_FLAG_doc" = "1" || DX_FLAG_html=0 + + +test "$DX_FLAG_chm" = "0" || DX_FLAG_html=0 + + + +fi + +if test "$DX_FLAG_html" = 1; then + + : +fi +if test "$DX_FLAG_html" = 1; then + DX_ENV="$DX_ENV GENERATE_HTML='YES'" +GENERATE_HTML=YES + + : +else + test "$DX_FLAG_chm" = 1 || DX_ENV="$DX_ENV GENERATE_HTML='NO'" +GENERATE_HTML=NO + + : +fi + + +# PostScript file generation: + + + + # Check whether --enable-doxygen-ps was given. +if test ${enable_doxygen_ps+y} +then : + enableval=$enable_doxygen_ps; +case "$enableval" in +#( +y|Y|yes|Yes|YES) + DX_FLAG_ps=1 + + +test "$DX_FLAG_doc" = "1" \ +|| as_fn_error $? "doxygen-ps requires doxygen-doc" "$LINENO" 5 + +;; #( +n|N|no|No|NO) + DX_FLAG_ps=0 + +;; #( +*) + as_fn_error $? "invalid value '$enableval' given to doxygen-ps" "$LINENO" 5 +;; +esac + +else $as_nop + +DX_FLAG_ps=1 + + +test "$DX_FLAG_doc" = "1" || DX_FLAG_ps=0 + + + +fi + +if test "$DX_FLAG_ps" = 1; then + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}latex", so it can be a program name with args. +set dummy ${ac_tool_prefix}latex; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_DX_LATEX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $DX_LATEX in + [\\/]* | ?:[\\/]*) + ac_cv_path_DX_LATEX="$DX_LATEX" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_DX_LATEX="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +DX_LATEX=$ac_cv_path_DX_LATEX +if test -n "$DX_LATEX"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DX_LATEX" >&5 +printf "%s\n" "$DX_LATEX" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_path_DX_LATEX"; then + ac_pt_DX_LATEX=$DX_LATEX + # Extract the first word of "latex", so it can be a program name with args. +set dummy latex; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_DX_LATEX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $ac_pt_DX_LATEX in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_DX_LATEX="$ac_pt_DX_LATEX" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_DX_LATEX="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +ac_pt_DX_LATEX=$ac_cv_path_ac_pt_DX_LATEX +if test -n "$ac_pt_DX_LATEX"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_LATEX" >&5 +printf "%s\n" "$ac_pt_DX_LATEX" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_pt_DX_LATEX" = x; then + DX_LATEX="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DX_LATEX=$ac_pt_DX_LATEX + fi +else + DX_LATEX="$ac_cv_path_DX_LATEX" +fi + +if test "$DX_FLAG_ps$DX_LATEX" = 1; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: latex not found - will not generate doxygen PostScript documentation" >&5 +printf "%s\n" "$as_me: WARNING: latex not found - will not generate doxygen PostScript documentation" >&2;} + DX_FLAG_ps=0 + +fi + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}makeindex", so it can be a program name with args. +set dummy ${ac_tool_prefix}makeindex; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_DX_MAKEINDEX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $DX_MAKEINDEX in + [\\/]* | ?:[\\/]*) + ac_cv_path_DX_MAKEINDEX="$DX_MAKEINDEX" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_DX_MAKEINDEX="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +DX_MAKEINDEX=$ac_cv_path_DX_MAKEINDEX +if test -n "$DX_MAKEINDEX"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DX_MAKEINDEX" >&5 +printf "%s\n" "$DX_MAKEINDEX" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_path_DX_MAKEINDEX"; then + ac_pt_DX_MAKEINDEX=$DX_MAKEINDEX + # Extract the first word of "makeindex", so it can be a program name with args. +set dummy makeindex; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_DX_MAKEINDEX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $ac_pt_DX_MAKEINDEX in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_DX_MAKEINDEX="$ac_pt_DX_MAKEINDEX" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_DX_MAKEINDEX="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +ac_pt_DX_MAKEINDEX=$ac_cv_path_ac_pt_DX_MAKEINDEX +if test -n "$ac_pt_DX_MAKEINDEX"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_MAKEINDEX" >&5 +printf "%s\n" "$ac_pt_DX_MAKEINDEX" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_pt_DX_MAKEINDEX" = x; then + DX_MAKEINDEX="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DX_MAKEINDEX=$ac_pt_DX_MAKEINDEX + fi +else + DX_MAKEINDEX="$ac_cv_path_DX_MAKEINDEX" +fi + +if test "$DX_FLAG_ps$DX_MAKEINDEX" = 1; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: makeindex not found - will not generate doxygen PostScript documentation" >&5 +printf "%s\n" "$as_me: WARNING: makeindex not found - will not generate doxygen PostScript documentation" >&2;} + DX_FLAG_ps=0 + +fi + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dvips", so it can be a program name with args. +set dummy ${ac_tool_prefix}dvips; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_DX_DVIPS+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $DX_DVIPS in + [\\/]* | ?:[\\/]*) + ac_cv_path_DX_DVIPS="$DX_DVIPS" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_DX_DVIPS="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +DX_DVIPS=$ac_cv_path_DX_DVIPS +if test -n "$DX_DVIPS"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DX_DVIPS" >&5 +printf "%s\n" "$DX_DVIPS" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_path_DX_DVIPS"; then + ac_pt_DX_DVIPS=$DX_DVIPS + # Extract the first word of "dvips", so it can be a program name with args. +set dummy dvips; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_DX_DVIPS+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $ac_pt_DX_DVIPS in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_DX_DVIPS="$ac_pt_DX_DVIPS" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_DX_DVIPS="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +ac_pt_DX_DVIPS=$ac_cv_path_ac_pt_DX_DVIPS +if test -n "$ac_pt_DX_DVIPS"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_DVIPS" >&5 +printf "%s\n" "$ac_pt_DX_DVIPS" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_pt_DX_DVIPS" = x; then + DX_DVIPS="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DX_DVIPS=$ac_pt_DX_DVIPS + fi +else + DX_DVIPS="$ac_cv_path_DX_DVIPS" +fi + +if test "$DX_FLAG_ps$DX_DVIPS" = 1; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: dvips not found - will not generate doxygen PostScript documentation" >&5 +printf "%s\n" "$as_me: WARNING: dvips not found - will not generate doxygen PostScript documentation" >&2;} + DX_FLAG_ps=0 + +fi + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}egrep", so it can be a program name with args. +set dummy ${ac_tool_prefix}egrep; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_DX_EGREP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $DX_EGREP in + [\\/]* | ?:[\\/]*) + ac_cv_path_DX_EGREP="$DX_EGREP" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_DX_EGREP="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +DX_EGREP=$ac_cv_path_DX_EGREP +if test -n "$DX_EGREP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DX_EGREP" >&5 +printf "%s\n" "$DX_EGREP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_path_DX_EGREP"; then + ac_pt_DX_EGREP=$DX_EGREP + # Extract the first word of "egrep", so it can be a program name with args. +set dummy egrep; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_DX_EGREP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $ac_pt_DX_EGREP in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_DX_EGREP="$ac_pt_DX_EGREP" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_DX_EGREP="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +ac_pt_DX_EGREP=$ac_cv_path_ac_pt_DX_EGREP +if test -n "$ac_pt_DX_EGREP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_EGREP" >&5 +printf "%s\n" "$ac_pt_DX_EGREP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_pt_DX_EGREP" = x; then + DX_EGREP="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DX_EGREP=$ac_pt_DX_EGREP + fi +else + DX_EGREP="$ac_cv_path_DX_EGREP" +fi + +if test "$DX_FLAG_ps$DX_EGREP" = 1; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: egrep not found - will not generate doxygen PostScript documentation" >&5 +printf "%s\n" "$as_me: WARNING: egrep not found - will not generate doxygen PostScript documentation" >&2;} + DX_FLAG_ps=0 + +fi + + : +fi +if test "$DX_FLAG_ps" = 1; then + + : +else + + : +fi + + +# PDF file generation: + + + + # Check whether --enable-doxygen-pdf was given. +if test ${enable_doxygen_pdf+y} +then : + enableval=$enable_doxygen_pdf; +case "$enableval" in +#( +y|Y|yes|Yes|YES) + DX_FLAG_pdf=1 + + +test "$DX_FLAG_doc" = "1" \ +|| as_fn_error $? "doxygen-pdf requires doxygen-doc" "$LINENO" 5 + +;; #( +n|N|no|No|NO) + DX_FLAG_pdf=0 + +;; #( +*) + as_fn_error $? "invalid value '$enableval' given to doxygen-pdf" "$LINENO" 5 +;; +esac + +else $as_nop + +DX_FLAG_pdf=1 + + +test "$DX_FLAG_doc" = "1" || DX_FLAG_pdf=0 + + + +fi + +if test "$DX_FLAG_pdf" = 1; then + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pdflatex", so it can be a program name with args. +set dummy ${ac_tool_prefix}pdflatex; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_DX_PDFLATEX+y} +then : + printf %s "(cached) " >&6 else $as_nop - with_shared_mem=16384 + case $DX_PDFLATEX in + [\\/]* | ?:[\\/]*) + ac_cv_path_DX_PDFLATEX="$DX_PDFLATEX" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_DX_PDFLATEX="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +DX_PDFLATEX=$ac_cv_path_DX_PDFLATEX +if test -n "$DX_PDFLATEX"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DX_PDFLATEX" >&5 +printf "%s\n" "$DX_PDFLATEX" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_path_DX_PDFLATEX"; then + ac_pt_DX_PDFLATEX=$DX_PDFLATEX + # Extract the first word of "pdflatex", so it can be a program name with args. +set dummy pdflatex; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_DX_PDFLATEX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $ac_pt_DX_PDFLATEX in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_DX_PDFLATEX="$ac_pt_DX_PDFLATEX" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_DX_PDFLATEX="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +ac_pt_DX_PDFLATEX=$ac_cv_path_ac_pt_DX_PDFLATEX +if test -n "$ac_pt_DX_PDFLATEX"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_PDFLATEX" >&5 +printf "%s\n" "$ac_pt_DX_PDFLATEX" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_pt_DX_PDFLATEX" = x; then + DX_PDFLATEX="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DX_PDFLATEX=$ac_pt_DX_PDFLATEX + fi +else + DX_PDFLATEX="$ac_cv_path_DX_PDFLATEX" +fi + +if test "$DX_FLAG_pdf$DX_PDFLATEX" = 1; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: pdflatex not found - will not generate doxygen PDF documentation" >&5 +printf "%s\n" "$as_me: WARNING: pdflatex not found - will not generate doxygen PDF documentation" >&2;} + DX_FLAG_pdf=0 + +fi + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}makeindex", so it can be a program name with args. +set dummy ${ac_tool_prefix}makeindex; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_DX_MAKEINDEX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $DX_MAKEINDEX in + [\\/]* | ?:[\\/]*) + ac_cv_path_DX_MAKEINDEX="$DX_MAKEINDEX" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_DX_MAKEINDEX="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +DX_MAKEINDEX=$ac_cv_path_DX_MAKEINDEX +if test -n "$DX_MAKEINDEX"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DX_MAKEINDEX" >&5 +printf "%s\n" "$DX_MAKEINDEX" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_path_DX_MAKEINDEX"; then + ac_pt_DX_MAKEINDEX=$DX_MAKEINDEX + # Extract the first word of "makeindex", so it can be a program name with args. +set dummy makeindex; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_DX_MAKEINDEX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $ac_pt_DX_MAKEINDEX in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_DX_MAKEINDEX="$ac_pt_DX_MAKEINDEX" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_DX_MAKEINDEX="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +ac_pt_DX_MAKEINDEX=$ac_cv_path_ac_pt_DX_MAKEINDEX +if test -n "$ac_pt_DX_MAKEINDEX"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_MAKEINDEX" >&5 +printf "%s\n" "$ac_pt_DX_MAKEINDEX" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_pt_DX_MAKEINDEX" = x; then + DX_MAKEINDEX="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DX_MAKEINDEX=$ac_pt_DX_MAKEINDEX + fi +else + DX_MAKEINDEX="$ac_cv_path_DX_MAKEINDEX" +fi + +if test "$DX_FLAG_pdf$DX_MAKEINDEX" = 1; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: makeindex not found - will not generate doxygen PDF documentation" >&5 +printf "%s\n" "$as_me: WARNING: makeindex not found - will not generate doxygen PDF documentation" >&2;} + DX_FLAG_pdf=0 + +fi + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}egrep", so it can be a program name with args. +set dummy ${ac_tool_prefix}egrep; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_DX_EGREP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $DX_EGREP in + [\\/]* | ?:[\\/]*) + ac_cv_path_DX_EGREP="$DX_EGREP" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_DX_EGREP="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +DX_EGREP=$ac_cv_path_DX_EGREP +if test -n "$DX_EGREP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DX_EGREP" >&5 +printf "%s\n" "$DX_EGREP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_path_DX_EGREP"; then + ac_pt_DX_EGREP=$DX_EGREP + # Extract the first word of "egrep", so it can be a program name with args. +set dummy egrep; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_DX_EGREP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $ac_pt_DX_EGREP in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_DX_EGREP="$ac_pt_DX_EGREP" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_DX_EGREP="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +ac_pt_DX_EGREP=$ac_cv_path_ac_pt_DX_EGREP +if test -n "$ac_pt_DX_EGREP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_EGREP" >&5 +printf "%s\n" "$ac_pt_DX_EGREP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_pt_DX_EGREP" = x; then + DX_EGREP="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DX_EGREP=$ac_pt_DX_EGREP + fi +else + DX_EGREP="$ac_cv_path_DX_EGREP" fi -GPU_SHAREDMEM=$with_shared_mem - -if test x$HAVE_CUDA = x0 -then : - GPU_SHAREDMEM=0 +if test "$DX_FLAG_pdf$DX_EGREP" = 1; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: egrep not found - will not generate doxygen PDF documentation" >&5 +printf "%s\n" "$as_me: WARNING: egrep not found - will not generate doxygen PDF documentation" >&2;} + DX_FLAG_pdf=0 fi -# -# Bifrost memory alignment -# + : +fi +if test "$DX_FLAG_pdf" = 1; then + : +else -# Check whether --with-alignment was given. -if test ${with_alignment+y} -then : - withval=$with_alignment; -else $as_nop - with_alignment=4096 + : fi -ALIGNMENT=$with_alignment - -# -# Bifrost proclog location -# +# LaTeX generation for PS and/or PDF: +if test "$DX_FLAG_ps" = 1 || test "$DX_FLAG_pdf" = 1; then + DX_ENV="$DX_ENV GENERATE_LATEX='YES'" +GENERATE_LATEX=YES +else + DX_ENV="$DX_ENV GENERATE_LATEX='NO'" +GENERATE_LATEX=NO +fi +# Paper size for PS and/or PDF: +case "$DOXYGEN_PAPER_SIZE" in +#( +"") + DOXYGEN_PAPER_SIZE="" -# Check whether --with-logging_dir was given. -if test ${with_logging_dir+y} -then : - withval=$with_logging_dir; HAVE_TMPFS=$with_logging_dir +;; #( +a4wide|a4|letter|legal|executive) + DX_ENV="$DX_ENV PAPER_SIZE='$DOXYGEN_PAPER_SIZE'" +PAPER_SIZE=$DOXYGEN_PAPER_SIZE -else $as_nop - HAVE_TMPFS=/tmp +;; #( +*) + as_fn_error $? "unknown DOXYGEN_PAPER_SIZE='$DOXYGEN_PAPER_SIZE'" "$LINENO" 5 +;; +esac -fi +# Rules: +if test $DX_FLAG_html -eq 1 +then : + DX_SNIPPET_html="## ------------------------------- ## +## Rules specific for HTML output. ## +## ------------------------------- ## +DX_CLEAN_HTML = \$(DX_DOCDIR)/html\\ + \$(DX_DOCDIR)/html - if test "$HAVE_TMPFS" = "/tmp"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for /dev/shm" >&5 -printf %s "checking for /dev/shm... " >&6; } -if test ${ac_cv_file__dev_shm+y} -then : - printf %s "(cached) " >&6 +" else $as_nop - test "$cross_compiling" = yes && - as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 -if test -r "/dev/shm"; then - ac_cv_file__dev_shm=yes -else - ac_cv_file__dev_shm=no -fi -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__dev_shm" >&5 -printf "%s\n" "$ac_cv_file__dev_shm" >&6; } -if test "x$ac_cv_file__dev_shm" = xyes -then : - HAVE_TMPFS=/dev/shm/bifrost - + DX_SNIPPET_html="" fi - - fi - - if test "$HAVE_TMPFS" = "/tmp"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for /Volumes/RAMDisk" >&5 -printf %s "checking for /Volumes/RAMDisk... " >&6; } -if test ${ac_cv_file__Volumes_RAMDisk+y} +if test $DX_FLAG_chi -eq 1 then : - printf %s "(cached) " >&6 + DX_SNIPPET_chi=" +DX_CLEAN_CHI = \$(DX_DOCDIR)/\$(PACKAGE).chi\\ + \$(DX_DOCDIR)/\$(PACKAGE).chi" else $as_nop - test "$cross_compiling" = yes && - as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 -if test -r "/Volumes/RAMDisk"; then - ac_cv_file__Volumes_RAMDisk=yes -else - ac_cv_file__Volumes_RAMDisk=no + DX_SNIPPET_chi="" fi -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__Volumes_RAMDisk" >&5 -printf "%s\n" "$ac_cv_file__Volumes_RAMDisk" >&6; } -if test "x$ac_cv_file__Volumes_RAMDisk" = xyes +if test $DX_FLAG_chm -eq 1 then : - HAVE_TMPFS=/Volumes/RAMDisk/bifrost - -fi + DX_SNIPPET_chm="## ------------------------------ ## +## Rules specific for CHM output. ## +## ------------------------------ ## - fi +DX_CLEAN_CHM = \$(DX_DOCDIR)/chm\\ + \$(DX_DOCDIR)/chm\ +${DX_SNIPPET_chi} - if test "$HAVE_TMPFS" = "/tmp"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for /tmp" >&5 -printf %s "checking for /tmp... " >&6; } -if test ${ac_cv_file__tmp+y} -then : - printf %s "(cached) " >&6 +" else $as_nop - test "$cross_compiling" = yes && - as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 -if test -r "/tmp"; then - ac_cv_file__tmp=yes -else - ac_cv_file__tmp=no -fi + DX_SNIPPET_chm="" fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__tmp" >&5 -printf "%s\n" "$ac_cv_file__tmp" >&6; } -if test "x$ac_cv_file__tmp" = xyes +if test $DX_FLAG_man -eq 1 then : - HAVE_TMPFS=/tmp - -fi - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $HAVE_TMPFS may have performance problems for logging" >&5 -printf "%s\n" "$as_me: WARNING: $HAVE_TMPFS may have performance problems for logging" >&2;} - HAVE_TMPFS=/tmp/bifrost + DX_SNIPPET_man="## ------------------------------ ## +## Rules specific for MAN output. ## +## ------------------------------ ## - fi - - -# -# Bifrost Features -# +DX_CLEAN_MAN = \$(DX_DOCDIR)/man\\ + \$(DX_DOCDIR)/man -# Check whether --enable-debug was given. -if test ${enable_debug+y} -then : - enableval=$enable_debug; enable_debug=yes +" else $as_nop - enable_debug=no + DX_SNIPPET_man="" fi - -HAVE_DEBUG=0 - -if test x$enable_debug != xno +if test $DX_FLAG_rtf -eq 1 then : - HAVE_DEBUG=1 + DX_SNIPPET_rtf="## ------------------------------ ## +## Rules specific for RTF output. ## +## ------------------------------ ## - CXXFLAGS="$CXXFLAGS -g" - NVCCFLAGS="$NVCCFLAGS -g" -fi +DX_CLEAN_RTF = \$(DX_DOCDIR)/rtf\\ + \$(DX_DOCDIR)/rtf -# Check whether --enable-trace was given. -if test ${enable_trace+y} -then : - enableval=$enable_trace; enable_trace=yes +" else $as_nop - enable_trace=no + DX_SNIPPET_rtf="" fi - -HAVE_TRACE=0 - -if test x$enable_trace != xno +if test $DX_FLAG_xml -eq 1 then : - HAVE_TRACE=1 - -fi - + DX_SNIPPET_xml="## ------------------------------ ## +## Rules specific for XML output. ## +## ------------------------------ ## +DX_CLEAN_XML = \$(DX_DOCDIR)/xml\\ + \$(DX_DOCDIR)/xml - # Check whether --enable-native_arch was given. -if test ${enable_native_arch+y} -then : - enableval=$enable_native_arch; enable_native_arch=no +" else $as_nop - enable_native_arch=yes + DX_SNIPPET_xml="" fi +if test $DX_FLAG_ps -eq 1 +then : + DX_SNIPPET_ps="## ----------------------------- ## +## Rules specific for PS output. ## +## ----------------------------- ## +DX_CLEAN_PS = \$(DX_DOCDIR)/\$(PACKAGE).ps\\ + \$(DX_DOCDIR)/\$(PACKAGE).ps - if test "$enable_native_arch" = "yes"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the compiler accepts '-march=native'" >&5 -printf %s "checking if the compiler accepts '-march=native'... " >&6; } - - CXXFLAGS_temp="$CXXFLAGS -march=native" - - ac_compile='$CXX -c $CXXFLAGS_temp conftest.$ac_ext >&5' - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - +DX_PS_GOAL = doxygen-ps +doxygen-ps: \$(DX_CLEAN_PS) -int -main (void) -{ +\$(DX_DOCDIR)/\$(PACKAGE).ps: \$(DX_DOCDIR)/\$(PACKAGE).tag + \$(DX_V_LATEX)cd \$(DX_DOCDIR)/latex; \\ + rm -f *.aux *.toc *.idx *.ind *.ilg *.log *.out; \\ + \$(DX_LATEX) refman.tex; \\ + \$(DX_MAKEINDEX) refman.idx; \\ + \$(DX_LATEX) refman.tex; \\ + countdown=5; \\ + while \$(DX_EGREP) 'Rerun (LaTeX|to get cross-references right)' \\ + refman.log > /dev/null 2>&1 \\ + && test \$\$countdown -gt 0; do \\ + \$(DX_LATEX) refman.tex; \\ + countdown=\`expr \$\$countdown - 1\`; \\ + done; \\ + \$(DX_DVIPS) -o ../\$(PACKAGE).ps refman.dvi - int i = 5; - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : - CXXFLAGS="$CXXFLAGS -march=native" - NVCCFLAGS="$NVCCFLAGS -Xcompiler \"-march=native\"" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } +" else $as_nop - enable_native_arch=no - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + DX_SNIPPET_ps="" fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - fi - - -# Check whether --enable-cuda_debug was given. -if test ${enable_cuda_debug+y} +if test $DX_FLAG_pdf -eq 1 then : - enableval=$enable_cuda_debug; enable_cuda_debug=yes -else $as_nop - enable_cuda_debug=no -fi + DX_SNIPPET_pdf="## ------------------------------ ## +## Rules specific for PDF output. ## +## ------------------------------ ## -HAVE_CUDA_DEBUG=0 - -if test x$enable_cuda_debug != xno -then : - HAVE_CUDA_DEBUG=1 +DX_CLEAN_PDF = \$(DX_DOCDIR)/\$(PACKAGE).pdf\\ + \$(DX_DOCDIR)/\$(PACKAGE).pdf - NVCCFLAGS="$NVCCFLAGS -G" -fi +DX_PDF_GOAL = doxygen-pdf +doxygen-pdf: \$(DX_CLEAN_PDF) +\$(DX_DOCDIR)/\$(PACKAGE).pdf: \$(DX_DOCDIR)/\$(PACKAGE).tag + \$(DX_V_LATEX)cd \$(DX_DOCDIR)/latex; \\ + rm -f *.aux *.toc *.idx *.ind *.ilg *.log *.out; \\ + \$(DX_PDFLATEX) refman.tex; \\ + \$(DX_MAKEINDEX) refman.idx; \\ + \$(DX_PDFLATEX) refman.tex; \\ + countdown=5; \\ + while \$(DX_EGREP) 'Rerun (LaTeX|to get cross-references right)' \\ + refman.log > /dev/null 2>&1 \\ + && test \$\$countdown -gt 0; do \\ + \$(DX_PDFLATEX) refman.tex; \\ + countdown=\`expr \$\$countdown - 1\`; \\ + done; \\ + mv refman.pdf ../\$(PACKAGE).pdf -# Check whether --with-mapped_ring_dir was given. -if test ${with_mapped_ring_dir+y} -then : - withval=$with_mapped_ring_dir; +" else $as_nop - mapped_ring_dir=/tmp/bifrost + DX_SNIPPET_pdf="" fi - -CPPFLAGS="$CPPFLAGS -DBF_MAPPED_RING_DIR=\"$mapped_ring_dir\"" - -# -# Python -# - -# Check whether --enable-python was given. -if test ${enable_python+y} +if test $DX_FLAG_ps -eq 1 -o $DX_FLAG_pdf -eq 1 then : - enableval=$enable_python; enable_python=no -else $as_nop - enable_python=yes -fi + DX_SNIPPET_latex="## ------------------------------------------------- ## +## Rules specific for LaTeX (shared for PS and PDF). ## +## ------------------------------------------------- ## -HAVE_PYTHON=0 +DX_V_LATEX = \$(_DX_v_LATEX_\$(V)) +_DX_v_LATEX_ = \$(_DX_v_LATEX_\$(AM_DEFAULT_VERBOSITY)) +_DX_v_LATEX_0 = @echo \" LATEX \" \$@; -if test x$enable_python != xno -then : - AX_WITH_PROG(PYTHON, python, no, $PATH) - if test x${PYTHON} != xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $PYTHON as ctypesgen" >&5 -printf %s "checking whether $PYTHON as ctypesgen... " >&6; } - if ! ${PYTHON} -c "import ctypesgen" 2>/dev/null -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: python module will not be built" >&5 -printf "%s\n" "$as_me: WARNING: python module will not be built" >&2;} -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } - HAVE_PYTHON=1 +DX_CLEAN_LATEX = \$(DX_DOCDIR)/latex\\ + \$(DX_DOCDIR)/latex -fi -fi +" +else $as_nop + DX_SNIPPET_latex="" fi -# Check whether --with-pybuild_flags was given. -if test ${with_pybuild_flags+y} +if test $DX_FLAG_doc -eq 1 then : - withval=$with_pybuild_flags; -fi - -PYBUILDFLAGS=$with_pybuild_flags - + DX_SNIPPET_doc="## --------------------------------- ## +## Format-independent Doxygen rules. ## +## --------------------------------- ## +${DX_SNIPPET_html}\ +${DX_SNIPPET_chm}\ +${DX_SNIPPET_man}\ +${DX_SNIPPET_rtf}\ +${DX_SNIPPET_xml}\ +${DX_SNIPPET_ps}\ +${DX_SNIPPET_pdf}\ +${DX_SNIPPET_latex}\ +DX_V_DXGEN = \$(_DX_v_DXGEN_\$(V)) +_DX_v_DXGEN_ = \$(_DX_v_DXGEN_\$(AM_DEFAULT_VERBOSITY)) +_DX_v_DXGEN_0 = @echo \" DXGEN \" \$<; -# Check whether --with-pyinstall_flags was given. -if test ${with_pyinstall_flags+y} -then : - withval=$with_pyinstall_flags; -fi +.PHONY: doxygen-run doxygen-doc \$(DX_PS_GOAL) \$(DX_PDF_GOAL) -PYINSTALLFLAGS=$with_pyinstall_flags +.INTERMEDIATE: doxygen-run \$(DX_PS_GOAL) \$(DX_PDF_GOAL) +doxygen-run: \$(DX_DOCDIR)/\$(PACKAGE).tag -# -# Docker -# +doxygen-doc: doxygen-run \$(DX_PS_GOAL) \$(DX_PDF_GOAL) -AX_WITH_PROG(DOCKER, docker, no, $PATH) -if test x${DOCKER} != xno -then : - HAVE_DOCKER=1 +\$(DX_DOCDIR)/\$(PACKAGE).tag: \$(DX_CONFIG) \$(pkginclude_HEADERS) + \$(A""M_V_at)rm -rf \$(DX_DOCDIR) + \$(DX_V_DXGEN)\$(DX_ENV) DOCDIR=\$(DX_DOCDIR) \$(DX_DOXYGEN) \$(DX_CONFIG) + \$(A""M_V_at)echo Timestamp >\$@ +DX_CLEANFILES = \\ + \$(DX_DOCDIR)/doxygen_sqlite3.db \\ + \$(DX_DOCDIR)/\$(PACKAGE).tag \\ + -r \\ + \$(DX_CLEAN_HTML) \\ + \$(DX_CLEAN_CHM) \\ + \$(DX_CLEAN_CHI) \\ + \$(DX_CLEAN_MAN) \\ + \$(DX_CLEAN_RTF) \\ + \$(DX_CLEAN_XML) \\ + \$(DX_CLEAN_PS) \\ + \$(DX_CLEAN_PDF) \\ + \$(DX_CLEAN_LATEX)" +else $as_nop + DX_SNIPPET_doc="" fi +DX_RULES="${DX_SNIPPET_doc}" -# -# Documentation -# -DX_DOT_FEATURE(OFF) -DX_HTML_FEATURE(ON) -DX_CHM_FEATURE(OFF) -DX_CHI_FEATURE(OFF) -DX_MAN_FEATURE(ON) -DX_RTF_FEATURE(OFF) -DX_XML_FEATURE(OFF) -DX_PDF_FEATURE(ON) -DX_PS_FEATURE(ON) -DX_INIT_DOXYGEN(bifrost) +#For debugging: +#echo DX_FLAG_doc=$DX_FLAG_doc +#echo DX_FLAG_dot=$DX_FLAG_dot +#echo DX_FLAG_man=$DX_FLAG_man +#echo DX_FLAG_html=$DX_FLAG_html +#echo DX_FLAG_chm=$DX_FLAG_chm +#echo DX_FLAG_chi=$DX_FLAG_chi +#echo DX_FLAG_rtf=$DX_FLAG_rtf +#echo DX_FLAG_xml=$DX_FLAG_xml +#echo DX_FLAG_pdf=$DX_FLAG_pdf +#echo DX_FLAG_ps=$DX_FLAG_ps +#echo DX_ENV=$DX_ENV + # # Version splitting @@ -21269,6 +24789,9 @@ fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: memory alignment: $ALIGNMENT" >&5 printf "%s\n" "$as_me: memory alignment: $ALIGNMENT" >&6;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: mapped ring directory: $mapped_ring_dir" >&5 +printf "%s\n" "$as_me: mapped ring directory: $mapped_ring_dir" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: logging directory: $HAVE_TMPFS" >&5 printf "%s\n" "$as_me: logging directory: $HAVE_TMPFS" >&6;} diff --git a/configure.ac b/configure.ac index 99a8c1313..22e44fd08 100644 --- a/configure.ac +++ b/configure.ac @@ -337,6 +337,8 @@ AS_IF([test x$HAVE_PYTHON = x1], [AC_MSG_NOTICE(python bindings: no)]) AC_MSG_NOTICE(memory alignment: $ALIGNMENT) + +AC_MSG_NOTICE(mapped ring directory: $mapped_ring_dir) AC_MSG_NOTICE(logging directory: $HAVE_TMPFS) From 7e89a4c2342dfebad8fee17ff620bd2d3e67791e Mon Sep 17 00:00:00 2001 From: jaycedowell Date: Tue, 22 Mar 2022 14:03:26 -0600 Subject: [PATCH 27/48] Bad merge. --- src/memory.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/memory.cpp b/src/memory.cpp index 2f3bac044..e5857c148 100644 --- a/src/memory.cpp +++ b/src/memory.cpp @@ -52,10 +52,6 @@ static_assert(BF_IS_POW2(BF_ALIGNMENT), "BF_ALIGNMENT must be a power of 2"); #undef BF_IS_POW2 //static_assert(BF_ALIGNMENT >= 8, "BF_ALIGNMENT must be >= 8"); -#ifndef BF_MAPPED_RING_DIR - #define BF_MAPPED_RING_DIR "/tmp/bifrost" -#endif - class MappedMgr { const char* base_mapped_dir = ((std::getenv("BIFROST_MAPPED_DIR") != NULL) \ ? std::getenv("BIFROST_MAPPED_DIR") \ @@ -353,6 +349,7 @@ BFstatus bfMemcpy(void* dst, case BF_SPACE_CUDA: kind = cudaMemcpyHostToDevice; break; // Is this the right thing to do? case BF_SPACE_CUDA_MANAGED: kind = cudaMemcpyDefault; break; +#endif default: BF_FAIL("Valid bfMemcpy dst space", BF_STATUS_INVALID_ARGUMENT); } break; @@ -373,7 +370,6 @@ BFstatus bfMemcpy(void* dst, case BF_SPACE_CUDA_MANAGED: kind = cudaMemcpyDefault; break; default: BF_FAIL("Valid bfMemcpy src space", BF_STATUS_INVALID_ARGUMENT); } -#if defined BF_CUDA_ENABLED && BF_CUDA_ENABLED BF_TRACE_STREAM(g_cuda_stream); BF_CHECK_CUDA(cudaMemcpyAsync(dst, src, count, kind, g_cuda_stream), BF_STATUS_MEM_OP_FAILED); @@ -452,7 +448,6 @@ BFstatus bfMemcpy2D(void* dst, case BF_SPACE_CUDA_MANAGED: kind = cudaMemcpyDefault; break; default: BF_FAIL("Valid bfMemcpy2D src space", BF_STATUS_INVALID_ARGUMENT); } -#if defined BF_CUDA_ENABLED && BF_CUDA_ENABLED BF_TRACE_STREAM(g_cuda_stream); BF_CHECK_CUDA(cudaMemcpy2DAsync(dst, dst_stride, src, src_stride, From e87ad47230beaa47f84173604303b7e78b13b2e1 Mon Sep 17 00:00:00 2001 From: jaycedowell Date: Tue, 22 Mar 2022 14:03:46 -0600 Subject: [PATCH 28/48] Include the mapped ring directory. --- src/bifrost/config.h.in | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/bifrost/config.h.in b/src/bifrost/config.h.in index 0559a878a..5aea1db8e 100644 --- a/src/bifrost/config.h.in +++ b/src/bifrost/config.h.in @@ -61,6 +61,9 @@ extern "C" { #define BF_TRACE_ENABLED @HAVE_TRACE@ #define BF_CUDA_DEBUG_ENABLED @HAVE_CUDA_DEBUG@ +// Mapped ring directory +#define BF_MAPPED_RING_DIR "@MAPPED_RING_DIR@" + // Logging directory #define BF_PROCLOG_DIR "@HAVE_TMPFS@" From 9e5169594cb788485f943b76ace198f79df24df5 Mon Sep 17 00:00:00 2001 From: jaycedowell Date: Tue, 22 Mar 2022 14:04:00 -0600 Subject: [PATCH 29/48] Use config.h instead of CPPFLAGS. --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 22e44fd08..004a359c5 100644 --- a/configure.ac +++ b/configure.ac @@ -212,7 +212,7 @@ AC_ARG_WITH([mapped_ring_dir], [directory to store mapped ring files in (default=/tmp/bifrost)])], [], [mapped_ring_dir=/tmp/bifrost]) -CPPFLAGS="$CPPFLAGS -DBF_MAPPED_RING_DIR=\"$mapped_ring_dir\"" +AC_SUBST([MAPPED_RING_DIR], [$mapped_ring_dir]) # # Python From f0cf402833271d54da868616887847f7031d2b7d Mon Sep 17 00:00:00 2001 From: jaycedowell Date: Tue, 22 Mar 2022 14:06:41 -0600 Subject: [PATCH 30/48] Updated for BF_MAPPED_RING_DIR. --- python/bifrost/version/__main__.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/python/bifrost/version/__main__.py b/python/bifrost/version/__main__.py index 1857ec51a..d6e8d01a4 100644 --- a/python/bifrost/version/__main__.py +++ b/python/bifrost/version/__main__.py @@ -1,5 +1,6 @@ from __future__ import print_function +import os import argparse from bifrost import __version__, __copyright__, __license__ @@ -21,6 +22,9 @@ def _yes_no(value): print(" NUMA support %s" % _yes_no(BF_NUMA_ENABLED)) print(" Hardware locality support: %s" % _yes_no(BF_HWLOC_ENABLED)) print(" Mellanox messaging accelerator (VMA) support: %s" % _yes_no(BF_VMA_ENABLED)) + print(" Mapped ring directory: %s" % BF_MAPPED_RING_DIR) + if os.getenv('BIFROST_MAPPED_DIR') is not None: + print("Mapped ring directory: override - %s" % os.getenv('BIFROST_MAPPED_DIR')) print(" Logging directory: %s" % BF_PROCLOG_DIR) print(" Debugging: %s" % _yes_no(BF_DEBUG_ENABLED)) print(" CUDA support: %s" % _yes_no(BF_CUDA_ENABLED)) From dca077f5b70a0eb36a89dcf3ec2babb84e8ae87e Mon Sep 17 00:00:00 2001 From: jaycedowell Date: Tue, 22 Mar 2022 14:07:19 -0600 Subject: [PATCH 31/48] Rebuild configure. --- configure | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/configure b/configure index a392c243a..6a27e9b7d 100755 --- a/configure +++ b/configure @@ -706,6 +706,7 @@ PYINSTALLFLAGS PYBUILDFLAGS PYTHON HAVE_PYTHON +MAPPED_RING_DIR HAVE_CUDA_DEBUG enable_native_arch HAVE_TRACE @@ -19952,7 +19953,8 @@ else $as_nop mapped_ring_dir=/tmp/bifrost fi -CPPFLAGS="$CPPFLAGS -DBF_MAPPED_RING_DIR=\"$mapped_ring_dir\"" +MAPPED_RING_DIR=$mapped_ring_dir + # # Python From 39c5a533e8d47fe788725143bc99f35706c8730e Mon Sep 17 00:00:00 2001 From: jaycedowell Date: Tue, 22 Mar 2022 14:56:16 -0600 Subject: [PATCH 32/48] Bad fix for a bad merge. --- src/memory.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/memory.cpp b/src/memory.cpp index e5857c148..5308e4630 100644 --- a/src/memory.cpp +++ b/src/memory.cpp @@ -368,8 +368,10 @@ BFstatus bfMemcpy(void* dst, } // Is this the right thing to do? case BF_SPACE_CUDA_MANAGED: kind = cudaMemcpyDefault; break; +#endif default: BF_FAIL("Valid bfMemcpy src space", BF_STATUS_INVALID_ARGUMENT); } +#if defined BF_CUDA_ENABLED && BF_CUDA_ENABLED BF_TRACE_STREAM(g_cuda_stream); BF_CHECK_CUDA(cudaMemcpyAsync(dst, src, count, kind, g_cuda_stream), BF_STATUS_MEM_OP_FAILED); @@ -446,8 +448,10 @@ BFstatus bfMemcpy2D(void* dst, } // Is this the right thing to do? case BF_SPACE_CUDA_MANAGED: kind = cudaMemcpyDefault; break; +#endif default: BF_FAIL("Valid bfMemcpy2D src space", BF_STATUS_INVALID_ARGUMENT); } +#if defined BF_CUDA_ENABLED && BF_CUDA_ENABLED BF_TRACE_STREAM(g_cuda_stream); BF_CHECK_CUDA(cudaMemcpy2DAsync(dst, dst_stride, src, src_stride, From 3b5e7e9f9df944b0f33791dd98b27803c694699f Mon Sep 17 00:00:00 2001 From: jaycedowell Date: Tue, 22 Mar 2022 15:19:05 -0600 Subject: [PATCH 33/48] Get the mapped ring space to work on MacOS. --- src/memory.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/memory.cpp b/src/memory.cpp index 5308e4630..1caa6ebee 100644 --- a/src/memory.cpp +++ b/src/memory.cpp @@ -52,6 +52,31 @@ static_assert(BF_IS_POW2(BF_ALIGNMENT), "BF_ALIGNMENT must be a power of 2"); #undef BF_IS_POW2 //static_assert(BF_ALIGNMENT >= 8, "BF_ALIGNMENT must be >= 8"); +#if defined __APPLE__ && __APPLE__ + +// Based on information from: +// https://hg.mozilla.org/mozilla-central/file/3d846420a907/xpcom/glue/FileUtils.cpp#l61 + +int posix_fallocate(int fd, off_t offset, off_t len) { + struct fstore_t flags; + flags.fst_flags = F_ALLOCATECONTIG || F_ALLOCATEALL; + flags.fst_posmod = F_PEOFPOSMODE; + flags.fst_offset = offset; + flags.fst_length = len; + + if( fcntl(fd, F_PREALLOCATE, &flags) == -1 ) { + // Try again but this time don't request a contiguous file + flags.fst_flags = F_ALLOCATEALL; + if( fcntl(fd, F_PREALLOCATE, &flags) == -1 ) { + return -1; + } + } + + return ftruncate(fd, len); +} + +#endif + class MappedMgr { const char* base_mapped_dir = ((std::getenv("BIFROST_MAPPED_DIR") != NULL) \ ? std::getenv("BIFROST_MAPPED_DIR") \ From d7cd7fe7231d7da86557a050cd51a1e2e0ee65f6 Mon Sep 17 00:00:00 2001 From: jaycedowell Date: Tue, 22 Mar 2022 15:22:09 -0600 Subject: [PATCH 34/48] No struct. --- src/memory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/memory.cpp b/src/memory.cpp index 1caa6ebee..77fcfa821 100644 --- a/src/memory.cpp +++ b/src/memory.cpp @@ -58,7 +58,7 @@ static_assert(BF_IS_POW2(BF_ALIGNMENT), "BF_ALIGNMENT must be a power of 2"); // https://hg.mozilla.org/mozilla-central/file/3d846420a907/xpcom/glue/FileUtils.cpp#l61 int posix_fallocate(int fd, off_t offset, off_t len) { - struct fstore_t flags; + fstore_t flags; flags.fst_flags = F_ALLOCATECONTIG || F_ALLOCATEALL; flags.fst_posmod = F_PEOFPOSMODE; flags.fst_offset = offset; From f2cd51afe084a48351ed37472654145af05945ac Mon Sep 17 00:00:00 2001 From: jaycedowell Date: Tue, 22 Mar 2022 15:26:13 -0600 Subject: [PATCH 35/48] Ugh, maybe I should switch to my laptop. --- src/memory.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/memory.cpp b/src/memory.cpp index 77fcfa821..abafb80c5 100644 --- a/src/memory.cpp +++ b/src/memory.cpp @@ -59,8 +59,8 @@ static_assert(BF_IS_POW2(BF_ALIGNMENT), "BF_ALIGNMENT must be a power of 2"); int posix_fallocate(int fd, off_t offset, off_t len) { fstore_t flags; - flags.fst_flags = F_ALLOCATECONTIG || F_ALLOCATEALL; - flags.fst_posmod = F_PEOFPOSMODE; + flags.fst_flags = F_ALLOCATECONTIG | F_ALLOCATEALL; + flags.fst_posmode = F_PEOFPOSMODE; flags.fst_offset = offset; flags.fst_length = len; From d2c96d0a3105c8170ecdcddc1f03a75c88b945f9 Mon Sep 17 00:00:00 2001 From: jaycedowell Date: Wed, 23 Mar 2022 10:35:39 -0600 Subject: [PATCH 36/48] Changed the default mapped ring directory location. --- configure | 5840 ++++++++++---------------------------------------- configure.ac | 4 +- 2 files changed, 1162 insertions(+), 4682 deletions(-) diff --git a/configure b/configure index 6a27e9b7d..f0a3b1ad6 100755 --- a/configure +++ b/configure @@ -661,50 +661,9 @@ LTLIBOBJS PACKAGE_VERSION_MICRO PACKAGE_VERSION_MINOR PACKAGE_VERSION_MAJOR -DX_RULES -PAPER_SIZE -DOXYGEN_PAPER_SIZE -GENERATE_LATEX -DX_PDFLATEX -DX_FLAG_pdf -DX_EGREP -DX_DVIPS -DX_MAKEINDEX -DX_LATEX -DX_FLAG_ps -DX_FLAG_html -GENERATE_CHI -DX_FLAG_chi -GENERATE_HTMLHELP -GENERATE_HTML -HHC_PATH -DX_HHC -DX_FLAG_chm -GENERATE_XML -DX_FLAG_xml -GENERATE_RTF -DX_FLAG_rtf -GENERATE_MAN -DX_FLAG_man -DOT_PATH -HAVE_DOT -DX_DOT -DX_FLAG_dot -PERL_PATH -DX_PERL -DX_DOXYGEN -DX_FLAG_doc -PROJECT -SRCDIR -DX_ENV -DX_DOCDIR -DX_CONFIG -DX_PROJECT HAVE_DOCKER -DOCKER PYINSTALLFLAGS PYBUILDFLAGS -PYTHON HAVE_PYTHON MAPPED_RING_DIR HAVE_CUDA_DEBUG @@ -731,10 +690,7 @@ HAVE_FLOAT128 HAVE_OPENMP LIBOBJS HAVE_RECVMSG -HAVE_CXX11 -HAVE_CXX14 SO_EXT -CTAGS SET_MAKE INSTALL_DATA INSTALL_SCRIPT @@ -833,7 +789,6 @@ with_aix_soname with_gnu_ld with_sysroot enable_libtool_lock -with_ctags enable_numa enable_hwloc enable_vma @@ -850,20 +805,8 @@ enable_native_arch enable_cuda_debug with_mapped_ring_dir enable_python -with_python with_pybuild_flags with_pyinstall_flags -with_docker -enable_doxygen_doc -enable_doxygen_dot -enable_doxygen_man -enable_doxygen_rtf -enable_doxygen_xml -enable_doxygen_chm -enable_doxygen_chi -enable_doxygen_html -enable_doxygen_ps -enable_doxygen_pdf ' ac_precious_vars='build_alias host_alias @@ -877,11 +820,7 @@ CXX CXXFLAGS CCC LT_SYS_LIBRARY_PATH -CXXCPP -CTAGS -PYTHON -DOCKER -DOXYGEN_PAPER_SIZE' +CXXCPP' # Initialize some variables set by options. @@ -1518,17 +1457,6 @@ Optional Features: --disable-native-arch disable native architecture compilation (default=no) --enable-cuda-debug enable CUDA debugging (nvcc -G; default=no) --disable-python disable building the Python bindings (default=no) - --disable-doxygen-doc don't generate any doxygen documentation - --enable-doxygen-dot generate graphics for doxygen documentation - --disable-doxygen-man don't generate doxygen manual pages - --enable-doxygen-rtf generate doxygen RTF documentation - --enable-doxygen-xml generate doxygen XML documentation - --enable-doxygen-chm generate doxygen compressed HTML help documentation - --enable-doxygen-chi generate doxygen separate compressed HTML help index - file - --disable-doxygen-html don't generate doxygen plain HTML documentation - --disable-doxygen-ps don't generate doxygen PostScript documentation - --disable-doxygen-pdf don't generate doxygen PDF documentation Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -1541,7 +1469,6 @@ Optional Packages: --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified). - --with-ctags=[PATH] absolute path to ctags executable --with-cuda-home CUDA install path (default=/usr/local/cuda) --with-nvcc-flags flags to pass to NVCC (default='-O3 -Xcompiler "-Wall"') @@ -1552,11 +1479,9 @@ Optional Packages: (default=autodetect) --with-mapped-ring-dir=... directory to store mapped ring files in - (default=/tmp/bifrost) - --with-python=[PATH] absolute path to python executable + (default=/tmp/bifrost_mapped) --with-pybuild-flags build flags for python (default='') --with-pyinstall-flags install flags for python (default='') - --with-docker=[PATH] absolute path to docker executable Some influential environment variables: CC C compiler command @@ -1571,11 +1496,6 @@ Some influential environment variables: LT_SYS_LIBRARY_PATH User-defined run-time library search path. CXXCPP C++ preprocessor - CTAGS Absolute path to ctags executable - PYTHON Absolute path to python executable - DOCKER Absolute path to docker executable - DOXYGEN_PAPER_SIZE - a4wide (default), a4, letter, legal or executive Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. @@ -17448,151 +17368,7 @@ printf "%s\n" "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi - - - - - - - - - - - if test -z "$CTAGS" -then : - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ctags executable path has been provided" >&5 -printf %s "checking whether ctags executable path has been provided... " >&6; } - -# Check whether --with-ctags was given. -if test ${with_ctags+y} -then : - withval=$with_ctags; - if test "$withval" != yes && test "$withval" != no -then : - - CTAGS="$withval" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CTAGS" >&5 -printf "%s\n" "$CTAGS" >&6; } - -else $as_nop - - CTAGS="" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - if test "$withval" != no -then : - - # Extract the first word of "ctags", so it can be a program name with args. -set dummy ctags; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_CTAGS+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $CTAGS in - [\\/]* | ?:[\\/]*) - ac_cv_path_CTAGS="$CTAGS" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_CTAGS="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -CTAGS=$ac_cv_path_CTAGS -if test -n "$CTAGS"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CTAGS" >&5 -printf "%s\n" "$CTAGS" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - -fi - -fi - -else $as_nop - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - # Extract the first word of "ctags", so it can be a program name with args. -set dummy ctags; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_CTAGS+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $CTAGS in - [\\/]* | ?:[\\/]*) - ac_cv_path_CTAGS="$CTAGS" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_CTAGS="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -CTAGS=$ac_cv_path_CTAGS -if test -n "$CTAGS"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CTAGS" >&5 -printf "%s\n" "$CTAGS" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - -fi - - -fi - - - - - - +AX_WITH_PROG(CTAGS, ctags) if test x${CTAGS} = x then : as_fn_error $? "Required program ctags was not found" "$LINENO" 5 @@ -17660,4762 +17436,1466 @@ _ACEOF ;; esac - ax_cxx_compile_alternatives="14 1y" ax_cxx_compile_cxx14_required=false - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - ac_success=no - +AX_CXX_COMPILE_STDCXX(14, noext, optional) +if test x$HAVE_CXX14 != x1 +then : + AX_CXX_COMPILE_STDCXX(11, noext, mandatory) +fi +ac_fn_cxx_check_func "$LINENO" "memset" "ac_cv_func_memset" +if test "x$ac_cv_func_memset" = xyes +then : + printf "%s\n" "#define HAVE_MEMSET 1" >>confdefs.h +fi +ac_fn_cxx_check_func "$LINENO" "rint" "ac_cv_func_rint" +if test "x$ac_cv_func_rint" = xyes +then : + printf "%s\n" "#define HAVE_RINT 1" >>confdefs.h +fi - if test x$ac_success = xno; then - for alternative in ${ax_cxx_compile_alternatives}; do - for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}"; do - cachevar=`printf "%s\n" "ax_cv_cxx_compile_cxx14_$switch" | $as_tr_sh` - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++14 features with $switch" >&5 -printf %s "checking whether $CXX supports C++14 features with $switch... " >&6; } -if eval test \${$cachevar+y} +ac_fn_cxx_check_func "$LINENO" "socket" "ac_cv_func_socket" +if test "x$ac_cv_func_socket" = xyes then : - printf %s "(cached) " >&6 -else $as_nop - ac_save_CXX="$CXX" - CXX="$CXX $switch" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + printf "%s\n" "#define HAVE_SOCKET 1" >>confdefs.h +fi -// If the compiler admits that it is not ready for C++11, why torture it? -// Hopefully, this will speed up the test. -#ifndef __cplusplus + for ac_func in recvmsg +do : + ac_fn_cxx_check_func "$LINENO" "recvmsg" "ac_cv_func_recvmsg" +if test "x$ac_cv_func_recvmsg" = xyes +then : + printf "%s\n" "#define HAVE_RECVMSG 1" >>confdefs.h + HAVE_RECVMSG=1 -#error "This is not a C++ compiler" +else $as_nop + HAVE_RECVMSG=0 -#elif __cplusplus < 201103L +fi -#error "This is not a C++11 compiler" +done +ac_fn_cxx_check_func "$LINENO" "sqrt" "ac_cv_func_sqrt" +if test "x$ac_cv_func_sqrt" = xyes +then : + printf "%s\n" "#define HAVE_SQRT 1" >>confdefs.h -#else +fi -namespace cxx11 -{ +ac_fn_cxx_check_func "$LINENO" "strerror" "ac_cv_func_strerror" +if test "x$ac_cv_func_strerror" = xyes +then : + printf "%s\n" "#define HAVE_STRERROR 1" >>confdefs.h - namespace test_static_assert - { +fi - template - struct check - { - static_assert(sizeof(int) <= sizeof(T), "not big enough"); - }; +ac_fn_cxx_check_header_compile "$LINENO" "arpa/inet.h" "ac_cv_header_arpa_inet_h" "$ac_includes_default" +if test "x$ac_cv_header_arpa_inet_h" = xyes +then : + printf "%s\n" "#define HAVE_ARPA_INET_H 1" >>confdefs.h - } +fi - namespace test_final_override - { +ac_fn_cxx_check_header_compile "$LINENO" "netdb.h" "ac_cv_header_netdb_h" "$ac_includes_default" +if test "x$ac_cv_header_netdb_h" = xyes +then : + printf "%s\n" "#define HAVE_NETDB_H 1" >>confdefs.h - struct Base - { - virtual ~Base() {} - virtual void f() {} - }; +fi - struct Derived : public Base - { - virtual ~Derived() override {} - virtual void f() override {} - }; +ac_fn_cxx_check_header_compile "$LINENO" "netinet/in.h" "ac_cv_header_netinet_in_h" "$ac_includes_default" +if test "x$ac_cv_header_netinet_in_h" = xyes +then : + printf "%s\n" "#define HAVE_NETINET_IN_H 1" >>confdefs.h - } +fi - namespace test_double_right_angle_brackets - { +ac_fn_cxx_check_header_compile "$LINENO" "sys/file.h" "ac_cv_header_sys_file_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_file_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_FILE_H 1" >>confdefs.h - template < typename T > - struct check {}; +fi - typedef check single_type; - typedef check> double_type; - typedef check>> triple_type; - typedef check>>> quadruple_type; +ac_fn_cxx_check_header_compile "$LINENO" "sys/ioctl.h" "ac_cv_header_sys_ioctl_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_ioctl_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_IOCTL_H 1" >>confdefs.h - } +fi - namespace test_decltype - { +ac_fn_cxx_check_header_compile "$LINENO" "sys/socket.h" "ac_cv_header_sys_socket_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_socket_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_SOCKET_H 1" >>confdefs.h - int - f() - { - int a = 1; - decltype(a) b = 2; - return a + b; - } +fi - } +ac_fn_cxx_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default" +if test "x$ac_cv_type__Bool" = xyes +then : - namespace test_type_deduction - { +printf "%s\n" "#define HAVE__BOOL 1" >>confdefs.h - template < typename T1, typename T2 > - struct is_same - { - static const bool value = false; - }; - template < typename T > - struct is_same - { - static const bool value = true; - }; +fi - template < typename T1, typename T2 > - auto - add(T1 a1, T2 a2) -> decltype(a1 + a2) - { - return a1 + a2; - } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5 +printf %s "checking for stdbool.h that conforms to C99... " >&6; } +if test ${ac_cv_header_stdbool_h+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include - int - test(const int c, volatile int v) - { - static_assert(is_same::value == true, ""); - static_assert(is_same::value == false, ""); - static_assert(is_same::value == false, ""); - auto ac = c; - auto av = v; - auto sumi = ac + av + 'x'; - auto sumf = ac + av + 1.0; - static_assert(is_same::value == true, ""); - static_assert(is_same::value == true, ""); - static_assert(is_same::value == true, ""); - static_assert(is_same::value == false, ""); - static_assert(is_same::value == true, ""); - return (sumf > 0.0) ? sumi : add(c, v); - } + #ifndef __bool_true_false_are_defined + #error "__bool_true_false_are_defined is not defined" + #endif + char a[__bool_true_false_are_defined == 1 ? 1 : -1]; - } + /* Regardless of whether this is C++ or "_Bool" is a + valid type name, "true" and "false" should be usable + in #if expressions and integer constant expressions, + and "bool" should be a valid type name. */ - namespace test_noexcept - { + #if !true + #error "'true' is not true" + #endif + #if true != 1 + #error "'true' is not equal to 1" + #endif + char b[true == 1 ? 1 : -1]; + char c[true]; - int f() { return 0; } - int g() noexcept { return 0; } + #if false + #error "'false' is not false" + #endif + #if false != 0 + #error "'false' is not equal to 0" + #endif + char d[false == 0 ? 1 : -1]; - static_assert(noexcept(f()) == false, ""); - static_assert(noexcept(g()) == true, ""); + enum { e = false, f = true, g = false * true, h = true * 256 }; - } + char i[(bool) 0.5 == true ? 1 : -1]; + char j[(bool) 0.0 == false ? 1 : -1]; + char k[sizeof (bool) > 0 ? 1 : -1]; - namespace test_constexpr - { - - template < typename CharT > - unsigned long constexpr - strlen_c_r(const CharT *const s, const unsigned long acc) noexcept - { - return *s ? strlen_c_r(s + 1, acc + 1) : acc; - } - - template < typename CharT > - unsigned long constexpr - strlen_c(const CharT *const s) noexcept - { - return strlen_c_r(s, 0UL); - } + struct sb { bool s: 1; bool t; } s; + char l[sizeof s.t > 0 ? 1 : -1]; - static_assert(strlen_c("") == 0UL, ""); - static_assert(strlen_c("1") == 1UL, ""); - static_assert(strlen_c("example") == 7UL, ""); - static_assert(strlen_c("another\0example") == 7UL, ""); + /* The following fails for + HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ + bool m[h]; + char n[sizeof m == h * sizeof m[0] ? 1 : -1]; + char o[-1 - (bool) 0 < 0 ? 1 : -1]; + /* Catch a bug in an HP-UX C compiler. See + https://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html + https://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html + */ + bool p = true; + bool *pp = &p; - } + /* C 1999 specifies that bool, true, and false are to be + macros, but C++ 2011 and later overrule this. */ + #if __cplusplus < 201103 + #ifndef bool + #error "bool is not defined" + #endif + #ifndef false + #error "false is not defined" + #endif + #ifndef true + #error "true is not defined" + #endif + #endif - namespace test_rvalue_references - { + /* If _Bool is available, repeat with it all the tests + above that used bool. */ + #ifdef HAVE__BOOL + struct sB { _Bool s: 1; _Bool t; } t; - template < int N > - struct answer - { - static constexpr int value = N; - }; + char q[(_Bool) 0.5 == true ? 1 : -1]; + char r[(_Bool) 0.0 == false ? 1 : -1]; + char u[sizeof (_Bool) > 0 ? 1 : -1]; + char v[sizeof t.t > 0 ? 1 : -1]; - answer<1> f(int&) { return answer<1>(); } - answer<2> f(const int&) { return answer<2>(); } - answer<3> f(int&&) { return answer<3>(); } + _Bool w[h]; + char x[sizeof m == h * sizeof m[0] ? 1 : -1]; + char y[-1 - (_Bool) 0 < 0 ? 1 : -1]; + _Bool z = true; + _Bool *pz = &p; + #endif - void - test() - { - int i = 0; - const int c = 0; - static_assert(decltype(f(i))::value == 1, ""); - static_assert(decltype(f(c))::value == 2, ""); - static_assert(decltype(f(0))::value == 3, ""); - } +int +main (void) +{ - } + bool ps = &s; + *pp |= p; + *pp |= ! p; - namespace test_uniform_initialization - { + #ifdef HAVE__BOOL + _Bool pt = &t; + *pz |= z; + *pz |= ! z; + #endif - struct test - { - static const int zero {}; - static const int one {1}; - }; + /* Refer to every declared value, so they cannot be + discarded as unused. */ + return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !j + !k + + !l + !m + !n + !o + !p + !pp + !ps + #ifdef HAVE__BOOL + + !q + !r + !u + !v + !w + !x + !y + !z + !pt + #endif + ); - static_assert(test::zero == 0, ""); - static_assert(test::one == 1, ""); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + ac_cv_header_stdbool_h=yes +else $as_nop + ac_cv_header_stdbool_h=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5 +printf "%s\n" "$ac_cv_header_stdbool_h" >&6; } - } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5 +printf %s "checking for GNU libc compatible malloc... " >&6; } +if test ${ac_cv_func_malloc_0_nonnull+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test "$cross_compiling" = yes +then : + case "$host_os" in # (( + # Guess yes on platforms where we know the result. + *-gnu* | freebsd* | netbsd* | openbsd* | bitrig* \ + | hpux* | solaris* | cygwin* | mingw* | msys* ) + ac_cv_func_malloc_0_nonnull=yes ;; + # If we don't know, assume the worst. + *) ac_cv_func_malloc_0_nonnull=no ;; + esac +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include - namespace test_lambdas - { +int +main (void) +{ +void *p = malloc (0); + int result = !p; + free (p); + return result; + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_run "$LINENO" +then : + ac_cv_func_malloc_0_nonnull=yes +else $as_nop + ac_cv_func_malloc_0_nonnull=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi - void - test1() - { - auto lambda1 = [](){}; - auto lambda2 = lambda1; - lambda1(); - lambda2(); - } +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5 +printf "%s\n" "$ac_cv_func_malloc_0_nonnull" >&6; } +if test $ac_cv_func_malloc_0_nonnull = yes +then : - int - test2() - { - auto a = [](int i, int j){ return i + j; }(1, 2); - auto b = []() -> int { return '0'; }(); - auto c = [=](){ return a + b; }(); - auto d = [&](){ return c; }(); - auto e = [a, &b](int x) mutable { - const auto identity = [](int y){ return y; }; - for (auto i = 0; i < a; ++i) - a += b--; - return x + identity(a + b); - }(0); - return a + b + c + d + e; - } +printf "%s\n" "#define HAVE_MALLOC 1" >>confdefs.h - int - test3() - { - const auto nullary = [](){ return 0; }; - const auto unary = [](int x){ return x; }; - using nullary_t = decltype(nullary); - using unary_t = decltype(unary); - const auto higher1st = [](nullary_t f){ return f(); }; - const auto higher2nd = [unary](nullary_t f1){ - return [unary, f1](unary_t f2){ return f2(unary(f1())); }; - }; - return higher1st(nullary) + higher2nd(nullary)(unary); - } +else $as_nop + printf "%s\n" "#define HAVE_MALLOC 0" >>confdefs.h - } + case " $LIBOBJS " in + *" malloc.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS malloc.$ac_objext" + ;; +esac - namespace test_variadic_templates - { - template - struct sum; +printf "%s\n" "#define malloc rpl_malloc" >>confdefs.h - template - struct sum - { - static constexpr auto value = N0 + sum::value; - }; +fi - template <> - struct sum<> - { - static constexpr auto value = 0; - }; - static_assert(sum<>::value == 0, ""); - static_assert(sum<1>::value == 1, ""); - static_assert(sum<23>::value == 23, ""); - static_assert(sum<1, 2>::value == 3, ""); - static_assert(sum<5, 5, 11>::value == 21, ""); - static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); - } +HAVE_OPENMP=0 - // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae - // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function - // because of this. - namespace test_template_alias_sfinae - { +AX_OPENMP +if test x$OPENMP_CXXFLAGS != x +then : + HAVE_OPENMP=1 - struct foo {}; +fi +if test x$HAVE_OPENMP != x1 +then : - template - using member = typename T::member_type; +else $as_nop + CXXFLAGS="$CXXFLAGS $OPENMP_CXXFLAGS" + LDFLAGS="$LDFLAGS $OPENMP_CXXFLAGS" +fi - template - void func(...) {} +ac_fn_cxx_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default" +if test "x$ac_cv_type_ptrdiff_t" = xyes +then : - template - void func(member*) {} +printf "%s\n" "#define HAVE_PTRDIFF_T 1" >>confdefs.h - void test(); - void test() { func(0); } +fi - } +ac_fn_c_find_intX_t "$LINENO" "16" "ac_cv_c_int16_t" +case $ac_cv_c_int16_t in #( + no|yes) ;; #( + *) -} // namespace cxx11 +printf "%s\n" "#define int16_t $ac_cv_c_int16_t" >>confdefs.h +;; +esac -#endif // __cplusplus >= 201103L +ac_fn_c_find_intX_t "$LINENO" "32" "ac_cv_c_int32_t" +case $ac_cv_c_int32_t in #( + no|yes) ;; #( + *) +printf "%s\n" "#define int32_t $ac_cv_c_int32_t" >>confdefs.h +;; +esac +ac_fn_c_find_intX_t "$LINENO" "64" "ac_cv_c_int64_t" +case $ac_cv_c_int64_t in #( + no|yes) ;; #( + *) +printf "%s\n" "#define int64_t $ac_cv_c_int64_t" >>confdefs.h +;; +esac -// If the compiler admits that it is not ready for C++14, why torture it? -// Hopefully, this will speed up the test. +ac_fn_c_find_intX_t "$LINENO" "8" "ac_cv_c_int8_t" +case $ac_cv_c_int8_t in #( + no|yes) ;; #( + *) -#ifndef __cplusplus +printf "%s\n" "#define int8_t $ac_cv_c_int8_t" >>confdefs.h +;; +esac -#error "This is not a C++ compiler" -#elif __cplusplus < 201402L + ac_fn_cxx_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default +" +if test "x$ac_cv_type_pid_t" = xyes +then : -#error "This is not a C++14 compiler" +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -#else + #if defined _WIN64 && !defined __CYGWIN__ + LLP64 + #endif -namespace cxx14 +int +main (void) { - namespace test_polymorphic_lambdas - { + ; + return 0; +} - int - test() - { - const auto lambda = [](auto&&... args){ - const auto istiny = [](auto x){ - return (sizeof(x) == 1UL) ? 1 : 0; - }; - const int aretiny[] = { istiny(args)... }; - return aretiny[0]; - }; - return lambda(1, 1L, 1.0f, '1'); - } +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + ac_pid_type='int' +else $as_nop + ac_pid_type='__int64' +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - } +printf "%s\n" "#define pid_t $ac_pid_type" >>confdefs.h - namespace test_binary_literals - { - constexpr auto ivii = 0b0000000000101010; - static_assert(ivii == 42, "wrong value"); +fi - } - namespace test_generalized_constexpr - { +ac_fn_cxx_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" +if test "x$ac_cv_type_size_t" = xyes +then : - template < typename CharT > - constexpr unsigned long - strlen_c(const CharT *const s) noexcept - { - auto length = 0UL; - for (auto p = s; *p; ++p) - ++length; - return length; - } +else $as_nop - static_assert(strlen_c("") == 0UL, ""); - static_assert(strlen_c("x") == 1UL, ""); - static_assert(strlen_c("test") == 4UL, ""); - static_assert(strlen_c("another\0test") == 7UL, ""); +printf "%s\n" "#define size_t unsigned int" >>confdefs.h - } +fi - namespace test_lambda_init_capture - { +ac_fn_cxx_check_type "$LINENO" "ssize_t" "ac_cv_type_ssize_t" "$ac_includes_default" +if test "x$ac_cv_type_ssize_t" = xyes +then : - int - test() - { - auto x = 0; - const auto lambda1 = [a = x](int b){ return a + b; }; - const auto lambda2 = [a = lambda1(x)](){ return a; }; - return lambda2(); - } +else $as_nop - } +printf "%s\n" "#define ssize_t int" >>confdefs.h - namespace test_digit_separators - { +fi - constexpr auto ten_million = 100'000'000; - static_assert(ten_million == 100000000, ""); +ac_fn_c_find_uintX_t "$LINENO" "16" "ac_cv_c_uint16_t" +case $ac_cv_c_uint16_t in #( + no|yes) ;; #( + *) - } - namespace test_return_type_deduction - { +printf "%s\n" "#define uint16_t $ac_cv_c_uint16_t" >>confdefs.h +;; + esac - auto f(int& x) { return x; } - decltype(auto) g(int& x) { return x; } +ac_fn_c_find_uintX_t "$LINENO" "32" "ac_cv_c_uint32_t" +case $ac_cv_c_uint32_t in #( + no|yes) ;; #( + *) - template < typename T1, typename T2 > - struct is_same - { - static constexpr auto value = false; - }; +printf "%s\n" "#define _UINT32_T 1" >>confdefs.h - template < typename T > - struct is_same - { - static constexpr auto value = true; - }; - int - test() - { - auto x = 0; - static_assert(is_same::value, ""); - static_assert(is_same::value, ""); - return x; - } +printf "%s\n" "#define uint32_t $ac_cv_c_uint32_t" >>confdefs.h +;; + esac - } +ac_fn_c_find_uintX_t "$LINENO" "64" "ac_cv_c_uint64_t" +case $ac_cv_c_uint64_t in #( + no|yes) ;; #( + *) + +printf "%s\n" "#define _UINT64_T 1" >>confdefs.h + + +printf "%s\n" "#define uint64_t $ac_cv_c_uint64_t" >>confdefs.h +;; + esac + +ac_fn_c_find_uintX_t "$LINENO" "8" "ac_cv_c_uint8_t" +case $ac_cv_c_uint8_t in #( + no|yes) ;; #( + *) + +printf "%s\n" "#define _UINT8_T 1" >>confdefs.h -} // namespace cxx14 -#endif // __cplusplus >= 201402L +printf "%s\n" "#define uint8_t $ac_cv_c_uint8_t" >>confdefs.h +;; + esac + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for long double with more range or precision than double" >&5 +printf %s "checking for long double with more range or precision than double... " >&6; } +if test ${ac_cv_type_long_double_wider+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + long double const a[] = + { + 0.0L, DBL_MIN, DBL_MAX, DBL_EPSILON, + LDBL_MIN, LDBL_MAX, LDBL_EPSILON + }; + long double + f (long double x) + { + return ((x + (unsigned long int) 10) * (-1 / x) + a[0] + + (x ? f (x) : 'c')); + } +int +main (void) +{ +static int test_array [1 - 2 * !((0 < ((DBL_MAX_EXP < LDBL_MAX_EXP) + + (DBL_MANT_DIG < LDBL_MANT_DIG) + - (LDBL_MAX_EXP < DBL_MAX_EXP) + - (LDBL_MANT_DIG < DBL_MANT_DIG))) + && (int) LDBL_EPSILON == 0 + )]; +test_array [0] = 0; +return test_array [0]; + ; + return 0; +} _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : - eval $cachevar=yes + ac_cv_type_long_double_wider=yes else $as_nop - eval $cachevar=no + ac_cv_type_long_double_wider=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - CXX="$ac_save_CXX" fi -eval ac_res=\$$cachevar - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } - if eval test x\$$cachevar = xyes; then - CXX="$CXX $switch" - if test -n "$CXXCPP" ; then - CXXCPP="$CXXCPP $switch" - fi - ac_success=yes - break - fi - done - if test x$ac_success = xyes; then - break - fi - done - fi - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - if test x$ax_cxx_compile_cxx14_required = xtrue; then - if test x$ac_success = xno; then - as_fn_error $? "*** A compiler with support for C++14 language features is required." "$LINENO" 5 - fi - fi - if test x$ac_success = xno; then - HAVE_CXX14=0 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: No compiler with C++14 support was found" >&5 -printf "%s\n" "$as_me: No compiler with C++14 support was found" >&6;} - else - HAVE_CXX14=1 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_double_wider" >&5 +printf "%s\n" "$ac_cv_type_long_double_wider" >&6; } + if test $ac_cv_type_long_double_wider = yes; then -printf "%s\n" "#define HAVE_CXX14 1" >>confdefs.h +printf "%s\n" "#define HAVE_LONG_DOUBLE_WIDER 1" >>confdefs.h fi +HAVE_FLOAT128=0 -if test x$HAVE_CXX14 != x1 +if test x$HAVE_HAVE_LONG_DOUBLE_WIDER = x1 then : - ax_cxx_compile_alternatives="11 0x" ax_cxx_compile_cxx11_required=true - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - ac_success=no + HAVE_FLOAT128=0 +fi +# +# NUMA +# +# Check whether --enable-numa was given. +if test ${enable_numa+y} +then : + enableval=$enable_numa; enable_numa=no +else $as_nop + enable_numa=yes +fi +HAVE_NUMA=0 - if test x$ac_success = xno; then - for alternative in ${ax_cxx_compile_alternatives}; do - for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}"; do - cachevar=`printf "%s\n" "ax_cv_cxx_compile_cxx11_$switch" | $as_tr_sh` - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features with $switch" >&5 -printf %s "checking whether $CXX supports C++11 features with $switch... " >&6; } -if eval test \${$cachevar+y} +if test x$enable_numa != xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for numa_node_of_cpu in -lnuma" >&5 +printf %s "checking for numa_node_of_cpu in -lnuma... " >&6; } +if test ${ac_cv_lib_numa_numa_node_of_cpu+y} then : printf %s "(cached) " >&6 else $as_nop - ac_save_CXX="$CXX" - CXX="$CXX $switch" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + ac_check_lib_save_LIBS=$LIBS +LIBS="-lnuma $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - -// If the compiler admits that it is not ready for C++11, why torture it? -// Hopefully, this will speed up the test. - -#ifndef __cplusplus - -#error "This is not a C++ compiler" - -#elif __cplusplus < 201103L - -#error "This is not a C++11 compiler" - -#else - -namespace cxx11 +namespace conftest { + extern "C" int numa_node_of_cpu (); +} +int +main (void) { +return conftest::numa_node_of_cpu (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO" +then : + ac_cv_lib_numa_numa_node_of_cpu=yes +else $as_nop + ac_cv_lib_numa_numa_node_of_cpu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_numa_numa_node_of_cpu" >&5 +printf "%s\n" "$ac_cv_lib_numa_numa_node_of_cpu" >&6; } +if test "x$ac_cv_lib_numa_numa_node_of_cpu" = xyes +then : + HAVE_NUMA=1 - namespace test_static_assert - { + LIBS="$LIBS -lnuma" +fi - template - struct check - { - static_assert(sizeof(int) <= sizeof(T), "not big enough"); - }; +fi - } +# +# HWLOC +# - namespace test_final_override - { +# Check whether --enable-hwloc was given. +if test ${enable_hwloc+y} +then : + enableval=$enable_hwloc; enable_hwloc=no +else $as_nop + enable_hwloc=yes +fi - struct Base - { - virtual ~Base() {} - virtual void f() {} - }; +HAVE_HWLOC=0 - struct Derived : public Base - { - virtual ~Derived() override {} - virtual void f() override {} - }; +if test x$enable_hwloc != xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for hwloc_topology_init in -lhwloc" >&5 +printf %s "checking for hwloc_topology_init in -lhwloc... " >&6; } +if test ${ac_cv_lib_hwloc_hwloc_topology_init+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lhwloc $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - } +namespace conftest { + extern "C" int hwloc_topology_init (); +} +int +main (void) +{ +return conftest::hwloc_topology_init (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO" +then : + ac_cv_lib_hwloc_hwloc_topology_init=yes +else $as_nop + ac_cv_lib_hwloc_hwloc_topology_init=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hwloc_hwloc_topology_init" >&5 +printf "%s\n" "$ac_cv_lib_hwloc_hwloc_topology_init" >&6; } +if test "x$ac_cv_lib_hwloc_hwloc_topology_init" = xyes +then : + HAVE_HWLOC=1 - namespace test_double_right_angle_brackets - { + LIBS="$LIBS -lhwloc" +fi - template < typename T > - struct check {}; +fi - typedef check single_type; - typedef check> double_type; - typedef check>> triple_type; - typedef check>>> quadruple_type; +# +# VMA +# - } +# Check whether --enable-vma was given. +if test ${enable_vma+y} +then : + enableval=$enable_vma; enable_vma=yes +else $as_nop + enable_vma=no +fi - namespace test_decltype - { +HAVE_VMA=0 - int - f() - { - int a = 1; - decltype(a) b = 2; - return a + b; - } +if test x$enable_vma != xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for recvfrom_zcopy in -lvma" >&5 +printf %s "checking for recvfrom_zcopy in -lvma... " >&6; } +if test ${ac_cv_lib_vma_recvfrom_zcopy+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lvma $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - } +namespace conftest { + extern "C" int recvfrom_zcopy (); +} +int +main (void) +{ +return conftest::recvfrom_zcopy (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO" +then : + ac_cv_lib_vma_recvfrom_zcopy=yes +else $as_nop + ac_cv_lib_vma_recvfrom_zcopy=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_vma_recvfrom_zcopy" >&5 +printf "%s\n" "$ac_cv_lib_vma_recvfrom_zcopy" >&6; } +if test "x$ac_cv_lib_vma_recvfrom_zcopy" = xyes +then : + HAVE_VMA=1 - namespace test_type_deduction - { + LIBS="$LIBS -lvma" +fi - template < typename T1, typename T2 > - struct is_same - { - static const bool value = false; - }; +fi - template < typename T > - struct is_same - { - static const bool value = true; - }; +# +# CUDA +# - template < typename T1, typename T2 > - auto - add(T1 a1, T2 a2) -> decltype(a1 + a2) - { - return a1 + a2; - } +################################# +# NOTE # +# This needs to come after all # +# other compiler/library tests # +# since it changes LIB to # +# include CUDA-specific entries # +################################# - int - test(const int c, volatile int v) - { - static_assert(is_same::value == true, ""); - static_assert(is_same::value == false, ""); - static_assert(is_same::value == false, ""); - auto ac = c; - auto av = v; - auto sumi = ac + av + 'x'; - auto sumf = ac + av + 1.0; - static_assert(is_same::value == true, ""); - static_assert(is_same::value == true, ""); - static_assert(is_same::value == true, ""); - static_assert(is_same::value == false, ""); - static_assert(is_same::value == true, ""); - return (sumf > 0.0) ? sumi : add(c, v); - } - } - namespace test_noexcept - { - int f() { return 0; } - int g() noexcept { return 0; } +# Check whether --with-cuda_home was given. +if test ${with_cuda_home+y} +then : + withval=$with_cuda_home; +else $as_nop + with_cuda_home=/usr/local/cuda +fi - static_assert(noexcept(f()) == false, ""); - static_assert(noexcept(g()) == true, ""); + CUDA_HOME=$with_cuda_home - } - namespace test_constexpr - { + # Check whether --enable-cuda was given. +if test ${enable_cuda+y} +then : + enableval=$enable_cuda; enable_cuda=no +else $as_nop + enable_cuda=yes +fi - template < typename CharT > - unsigned long constexpr - strlen_c_r(const CharT *const s, const unsigned long acc) noexcept - { - return *s ? strlen_c_r(s + 1, acc + 1) : acc; - } - template < typename CharT > - unsigned long constexpr - strlen_c(const CharT *const s) noexcept - { - return strlen_c_r(s, 0UL); - } + HAVE_CUDA=0 - static_assert(strlen_c("") == 0UL, ""); - static_assert(strlen_c("1") == 1UL, ""); - static_assert(strlen_c("example") == 7UL, ""); - static_assert(strlen_c("another\0example") == 7UL, ""); + CUDA_VERSION=0 - } + GPU_MAX_ARCH=0 - namespace test_rvalue_references - { + if test "$enable_cuda" != "no"; then + HAVE_CUDA=1 - template < int N > - struct answer - { - static constexpr int value = N; - }; - answer<1> f(int&) { return answer<1>(); } - answer<2> f(const int&) { return answer<2>(); } - answer<3> f(int&&) { return answer<3>(); } + # Extract the first word of "nvcc", so it can be a program name with args. +set dummy nvcc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_NVCC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $NVCC in + [\\/]* | ?:[\\/]*) + ac_cv_path_NVCC="$NVCC" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$CUDA_HOME/bin:$PATH" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_NVCC="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS - void - test() - { - int i = 0; - const int c = 0; - static_assert(decltype(f(i))::value == 1, ""); - static_assert(decltype(f(c))::value == 2, ""); - static_assert(decltype(f(0))::value == 3, ""); - } + test -z "$ac_cv_path_NVCC" && ac_cv_path_NVCC="no" + ;; +esac +fi +NVCC=$ac_cv_path_NVCC +if test -n "$NVCC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $NVCC" >&5 +printf "%s\n" "$NVCC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi - } - namespace test_uniform_initialization - { + # Extract the first word of "nvprune", so it can be a program name with args. +set dummy nvprune; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_NVPRUNE+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $NVPRUNE in + [\\/]* | ?:[\\/]*) + ac_cv_path_NVPRUNE="$NVPRUNE" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$CUDA_HOME/bin:$PATH" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_NVPRUNE="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS - struct test - { - static const int zero {}; - static const int one {1}; - }; + test -z "$ac_cv_path_NVPRUNE" && ac_cv_path_NVPRUNE="no" + ;; +esac +fi +NVPRUNE=$ac_cv_path_NVPRUNE +if test -n "$NVPRUNE"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $NVPRUNE" >&5 +printf "%s\n" "$NVPRUNE" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi - static_assert(test::zero == 0, ""); - static_assert(test::one == 1, ""); - } + # Extract the first word of "cuobjdump", so it can be a program name with args. +set dummy cuobjdump; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_CUOBJDUMP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $CUOBJDUMP in + [\\/]* | ?:[\\/]*) + ac_cv_path_CUOBJDUMP="$CUOBJDUMP" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$CUDA_HOME/bin:$PATH" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_CUOBJDUMP="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS - namespace test_lambdas - { + test -z "$ac_cv_path_CUOBJDUMP" && ac_cv_path_CUOBJDUMP="no" + ;; +esac +fi +CUOBJDUMP=$ac_cv_path_CUOBJDUMP +if test -n "$CUOBJDUMP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CUOBJDUMP" >&5 +printf "%s\n" "$CUOBJDUMP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi - void - test1() - { - auto lambda1 = [](){}; - auto lambda2 = lambda1; - lambda1(); - lambda2(); - } - int - test2() - { - auto a = [](int i, int j){ return i + j; }(1, 2); - auto b = []() -> int { return '0'; }(); - auto c = [=](){ return a + b; }(); - auto d = [&](){ return c; }(); - auto e = [a, &b](int x) mutable { - const auto identity = [](int y){ return y; }; - for (auto i = 0; i < a; ++i) - a += b--; - return x + identity(a + b); - }(0); - return a + b + c + d + e; - } + fi - int - test3() - { - const auto nullary = [](){ return 0; }; - const auto unary = [](int x){ return x; }; - using nullary_t = decltype(nullary); - using unary_t = decltype(unary); - const auto higher1st = [](nullary_t f){ return f(); }; - const auto higher2nd = [unary](nullary_t f1){ - return [unary, f1](unary_t f2){ return f2(unary(f1())); }; - }; - return higher1st(nullary) + higher2nd(nullary)(unary); - } + if test "$HAVE_CUDA" = "1"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a working CUDA installation" >&5 +printf %s "checking for a working CUDA installation... " >&6; } - } + CXXFLAGS_save="$CXXFLAGS" + LDFLAGS_save="$LDFLAGS" + LIBS_save="$LIBS" - namespace test_variadic_templates - { + ac_compile='$NVCC -c $NVCCFLAGS conftest.$ac_ext >&5' + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - template - struct sum; - template - struct sum - { - static constexpr auto value = N0 + sum::value; - }; + #include + #include +int +main (void) +{ +cudaMalloc(0, 0); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : - template <> - struct sum<> - { - static constexpr auto value = 0; - }; +else $as_nop + HAVE_CUDA=0 - static_assert(sum<>::value == 0, ""); - static_assert(sum<1>::value == 1, ""); - static_assert(sum<23>::value == 23, ""); - static_assert(sum<1, 2>::value == 3, ""); - static_assert(sum<5, 5, 11>::value == 21, ""); - static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - } + if test "$HAVE_CUDA" = "1"; then + LDFLAGS="-L$CUDA_HOME/lib64 -L$CUDA_HOME/lib" + LIBS="$LIBS -lcuda -lcudart" - // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae - // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function - // because of this. - namespace test_template_alias_sfinae - { - - struct foo {}; - - template - using member = typename T::member_type; - - template - void func(...) {} - - template - void func(member*) {} - - void test(); + ac_link='$NVCC -o conftest$ac_exeext $NVCCFLAGS $LDFLAGS $LIBS conftest.$ac_ext >&5' + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - void test() { func(0); } - } + #include + #include +int +main (void) +{ +cudaMalloc(0, 0); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO" +then : + CUDA_VERSION=$( ${NVCC} --version | ${GREP} -Po -e "release.*," | cut -d, -f1 | cut -d\ -f2 ) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes - v$CUDA_VERSION" >&5 +printf "%s\n" "yes - v$CUDA_VERSION" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + HAVE_CUDA=0 -} // namespace cxx11 +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + HAVE_CUDA=0 -#endif // __cplusplus >= 201103L + fi + CXXFLAGS="$CXXFLAGS_save" + LDFLAGS="$LDFLAGS_save" + LIBS="$LIBS_save" + fi -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" +# Check whether --with-nvcc_flags was given. +if test ${with_nvcc_flags+y} then : - eval $cachevar=yes + withval=$with_nvcc_flags; else $as_nop - eval $cachevar=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - CXX="$ac_save_CXX" + with_nvcc_flags='-O3 -Xcompiler "-Wall"' fi -eval ac_res=\$$cachevar - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } - if eval test x\$$cachevar = xyes; then - CXX="$CXX $switch" - if test -n "$CXXCPP" ; then - CXXCPP="$CXXCPP $switch" - fi - ac_success=yes - break - fi - done - if test x$ac_success = xyes; then - break - fi - done - fi - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - if test x$ax_cxx_compile_cxx11_required = xtrue; then - if test x$ac_success = xno; then - as_fn_error $? "*** A compiler with support for C++11 language features is required." "$LINENO" 5 - fi - fi - if test x$ac_success = xno; then - HAVE_CXX11=0 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: No compiler with C++11 support was found" >&5 -printf "%s\n" "$as_me: No compiler with C++11 support was found" >&6;} - else - HAVE_CXX11=1 + NVCCFLAGS=$with_nvcc_flags -printf "%s\n" "#define HAVE_CXX11 1" >>confdefs.h + if test "$HAVE_CUDA" = "1"; then + CPPFLAGS="$CPPFLAGS -DBF_CUDA_ENABLED=1" + CXXFLAGS="$CXXFLAGS -DBF_CUDA_ENABLED=1" + NVCCFLAGS="$NVCCFLAGS -DBF_CUDA_ENABLED=1" + LDFLAGS="$LDFLAGS -L$CUDA_HOME/lib64 -L$CUDA_HOME/lib" + LIBS="$LIBS -lcuda -lcudart -lnvrtc -lcublas -lcudadevrt -L. -lcufft_static_pruned -lculibos -lnvToolsExt" fi -fi -ac_fn_cxx_check_func "$LINENO" "memset" "ac_cv_func_memset" -if test "x$ac_cv_func_memset" = xyes +# Check whether --with-gpu_archs was given. +if test ${with_gpu_archs+y} then : - printf "%s\n" "#define HAVE_MEMSET 1" >>confdefs.h - + withval=$with_gpu_archs; +else $as_nop + with_gpu_archs='auto' fi -ac_fn_cxx_check_func "$LINENO" "rint" "ac_cv_func_rint" -if test "x$ac_cv_func_rint" = xyes -then : - printf "%s\n" "#define HAVE_RINT 1" >>confdefs.h + if test "$HAVE_CUDA" = "1"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for valid CUDA architectures" >&5 +printf %s "checking for valid CUDA architectures... " >&6; } + ar_supported=$( ${NVCC} -h | ${GREP} -Po "'compute_[0-9]{2,3}" | cut -d_ -f2 | sort | uniq ) + ar_supported_flat=$( echo $ar_supported | xargs ) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: found: $ar_supported_flat" >&5 +printf "%s\n" "found: $ar_supported_flat" >&6; } -fi + if test "$with_gpu_archs" = "auto"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking which CUDA architectures to target" >&5 +printf %s "checking which CUDA architectures to target... " >&6; } -ac_fn_cxx_check_func "$LINENO" "socket" "ac_cv_func_socket" -if test "x$ac_cv_func_socket" = xyes + CXXFLAGS_save="$CXXFLAGS" + LDFLAGS_save="$LDFLAGS" + LIBS_save="$LIBS" + + LDFLAGS="-L$CUDA_HOME/lib64 -L$CUDA_HOME/lib" + LIBS="-lcuda -lcudart" + ac_run='$NVCC -o conftest$ac_ext $LDFLAGS $LIBS conftest.$ac_ext>&5' + if test "$cross_compiling" = yes then : - printf "%s\n" "#define HAVE_SOCKET 1" >>confdefs.h + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -fi + #include + #include + #include + #include + #include +int +main (void) +{ - for ac_func in recvmsg -do : - ac_fn_cxx_check_func "$LINENO" "recvmsg" "ac_cv_func_recvmsg" -if test "x$ac_cv_func_recvmsg" = xyes + std::set archs; + int major, minor, arch; + int deviceCount = 0; + cudaGetDeviceCount(&deviceCount); + if( deviceCount == 0 ) { + return 1; + } + std::ofstream fh; + fh.open("confarchs.out"); + for(int dev=0; dev 0 ) { + fh << " "; + } + fh << arch; + } + arch += minor; + if( archs.count(arch) == 0 ) { + archs.insert(arch); + fh << " " << arch; + } + } + fh.close(); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_run "$LINENO" then : - printf "%s\n" "#define HAVE_RECVMSG 1" >>confdefs.h - HAVE_RECVMSG=1 + GPU_ARCHS=`cat confarchs.out` -else $as_nop - HAVE_RECVMSG=0 + ar_supported=$( ${NVCC} -h | ${GREP} -Po "'compute_[0-9]{2,3}" | cut -d_ -f2 | sort | uniq ) + ar_valid=$( echo $GPU_ARCHS $ar_supported | xargs -n1 | sort | uniq -d | xargs ) + if test "$ar_valid" = ""; then + as_fn_error $? "failed to find any supported" "$LINENO" 5 + else + GPU_ARCHS=$ar_valid + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $GPU_ARCHS" >&5 +printf "%s\n" "$GPU_ARCHS" >&6; } + fi +else $as_nop + as_fn_error $? "failed to find any" "$LINENO" 5 fi - -done -ac_fn_cxx_check_func "$LINENO" "sqrt" "ac_cv_func_sqrt" -if test "x$ac_cv_func_sqrt" = xyes -then : - printf "%s\n" "#define HAVE_SQRT 1" >>confdefs.h - +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi -ac_fn_cxx_check_func "$LINENO" "strerror" "ac_cv_func_strerror" -if test "x$ac_cv_func_strerror" = xyes -then : - printf "%s\n" "#define HAVE_STRERROR 1" >>confdefs.h -fi + CXXFLAGS="$CXXFLAGS_save" + LDFLAGS="$LDFLAGS_save" + LIBS="$LIBS_save" + else + GPU_ARCHS=$with_gpu_archs -ac_fn_cxx_check_header_compile "$LINENO" "arpa/inet.h" "ac_cv_header_arpa_inet_h" "$ac_includes_default" -if test "x$ac_cv_header_arpa_inet_h" = xyes -then : - printf "%s\n" "#define HAVE_ARPA_INET_H 1" >>confdefs.h + fi -fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for valid requested CUDA architectures" >&5 +printf %s "checking for valid requested CUDA architectures... " >&6; } + ar_requested=$( echo "$GPU_ARCHS" | wc -w ) + ar_valid=$( echo $GPU_ARCHS $ar_supported | xargs -n1 | sort | uniq -d | xargs ) + ar_found=$( echo $ar_valid | wc -w ) + if test "$ar_requested" = "$ar_found"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + else + as_fn_error $? "only '$ar_valid' are supported" "$LINENO" 5 + fi -ac_fn_cxx_check_header_compile "$LINENO" "netdb.h" "ac_cv_header_netdb_h" "$ac_includes_default" -if test "x$ac_cv_header_netdb_h" = xyes -then : - printf "%s\n" "#define HAVE_NETDB_H 1" >>confdefs.h + ar_max_valid=$(echo $ar_valid | ${SED} -e 's/.* //g;' ) + GPU_MAX_ARCH=$ar_max_valid -fi -ac_fn_cxx_check_header_compile "$LINENO" "netinet/in.h" "ac_cv_header_netinet_in_h" "$ac_includes_default" -if test "x$ac_cv_header_netinet_in_h" = xyes -then : - printf "%s\n" "#define HAVE_NETINET_IN_H 1" >>confdefs.h + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Pascal-style CUDA managed memory" >&5 +printf %s "checking for Pascal-style CUDA managed memory... " >&6; } + cm_invalid=$( echo $GPU_ARCHS | ${SED} -e 's/\b[1-5][0-9]\b/PRE/g;' ) + if ! echo $cm_invalid | ${GREP} -q PRE; then + GPU_PASCAL_MANAGEDMEM=1 -fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + else + GPU_PASCAL_MANAGEDMEM=0 -ac_fn_cxx_check_header_compile "$LINENO" "sys/file.h" "ac_cv_header_sys_file_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_file_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_FILE_H 1" >>confdefs.h + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + fi + else + GPU_PASCAL_MANAGEDMEM=0 -fi + fi -ac_fn_cxx_check_header_compile "$LINENO" "sys/ioctl.h" "ac_cv_header_sys_ioctl_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_ioctl_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_IOCTL_H 1" >>confdefs.h -fi -ac_fn_cxx_check_header_compile "$LINENO" "sys/socket.h" "ac_cv_header_sys_socket_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_socket_h" = xyes +# Check whether --with-shared_mem was given. +if test ${with_shared_mem+y} then : - printf "%s\n" "#define HAVE_SYS_SOCKET_H 1" >>confdefs.h - -fi - -ac_fn_cxx_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default" -if test "x$ac_cv_type__Bool" = xyes -then : - -printf "%s\n" "#define HAVE__BOOL 1" >>confdefs.h - - -fi - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5 -printf %s "checking for stdbool.h that conforms to C99... " >&6; } -if test ${ac_cv_header_stdbool_h+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - - #ifndef __bool_true_false_are_defined - #error "__bool_true_false_are_defined is not defined" - #endif - char a[__bool_true_false_are_defined == 1 ? 1 : -1]; - - /* Regardless of whether this is C++ or "_Bool" is a - valid type name, "true" and "false" should be usable - in #if expressions and integer constant expressions, - and "bool" should be a valid type name. */ - - #if !true - #error "'true' is not true" - #endif - #if true != 1 - #error "'true' is not equal to 1" - #endif - char b[true == 1 ? 1 : -1]; - char c[true]; - - #if false - #error "'false' is not false" - #endif - #if false != 0 - #error "'false' is not equal to 0" - #endif - char d[false == 0 ? 1 : -1]; - - enum { e = false, f = true, g = false * true, h = true * 256 }; - - char i[(bool) 0.5 == true ? 1 : -1]; - char j[(bool) 0.0 == false ? 1 : -1]; - char k[sizeof (bool) > 0 ? 1 : -1]; - - struct sb { bool s: 1; bool t; } s; - char l[sizeof s.t > 0 ? 1 : -1]; - - /* The following fails for - HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ - bool m[h]; - char n[sizeof m == h * sizeof m[0] ? 1 : -1]; - char o[-1 - (bool) 0 < 0 ? 1 : -1]; - /* Catch a bug in an HP-UX C compiler. See - https://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html - https://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html - */ - bool p = true; - bool *pp = &p; - - /* C 1999 specifies that bool, true, and false are to be - macros, but C++ 2011 and later overrule this. */ - #if __cplusplus < 201103 - #ifndef bool - #error "bool is not defined" - #endif - #ifndef false - #error "false is not defined" - #endif - #ifndef true - #error "true is not defined" - #endif - #endif - - /* If _Bool is available, repeat with it all the tests - above that used bool. */ - #ifdef HAVE__BOOL - struct sB { _Bool s: 1; _Bool t; } t; - - char q[(_Bool) 0.5 == true ? 1 : -1]; - char r[(_Bool) 0.0 == false ? 1 : -1]; - char u[sizeof (_Bool) > 0 ? 1 : -1]; - char v[sizeof t.t > 0 ? 1 : -1]; - - _Bool w[h]; - char x[sizeof m == h * sizeof m[0] ? 1 : -1]; - char y[-1 - (_Bool) 0 < 0 ? 1 : -1]; - _Bool z = true; - _Bool *pz = &p; - #endif - -int -main (void) -{ - - bool ps = &s; - *pp |= p; - *pp |= ! p; - - #ifdef HAVE__BOOL - _Bool pt = &t; - *pz |= z; - *pz |= ! z; - #endif - - /* Refer to every declared value, so they cannot be - discarded as unused. */ - return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !j + !k - + !l + !m + !n + !o + !p + !pp + !ps - #ifdef HAVE__BOOL - + !q + !r + !u + !v + !w + !x + !y + !z + !pt - #endif - ); - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : - ac_cv_header_stdbool_h=yes -else $as_nop - ac_cv_header_stdbool_h=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5 -printf "%s\n" "$ac_cv_header_stdbool_h" >&6; } - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5 -printf %s "checking for GNU libc compatible malloc... " >&6; } -if test ${ac_cv_func_malloc_0_nonnull+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test "$cross_compiling" = yes -then : - case "$host_os" in # (( - # Guess yes on platforms where we know the result. - *-gnu* | freebsd* | netbsd* | openbsd* | bitrig* \ - | hpux* | solaris* | cygwin* | mingw* | msys* ) - ac_cv_func_malloc_0_nonnull=yes ;; - # If we don't know, assume the worst. - *) ac_cv_func_malloc_0_nonnull=no ;; - esac -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -int -main (void) -{ -void *p = malloc (0); - int result = !p; - free (p); - return result; - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_run "$LINENO" -then : - ac_cv_func_malloc_0_nonnull=yes -else $as_nop - ac_cv_func_malloc_0_nonnull=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5 -printf "%s\n" "$ac_cv_func_malloc_0_nonnull" >&6; } -if test $ac_cv_func_malloc_0_nonnull = yes -then : - -printf "%s\n" "#define HAVE_MALLOC 1" >>confdefs.h - -else $as_nop - printf "%s\n" "#define HAVE_MALLOC 0" >>confdefs.h - - case " $LIBOBJS " in - *" malloc.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS malloc.$ac_objext" - ;; -esac - - -printf "%s\n" "#define malloc rpl_malloc" >>confdefs.h - -fi - - - -HAVE_OPENMP=0 - - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for OpenMP flag of C++ compiler" >&5 -printf %s "checking for OpenMP flag of C++ compiler... " >&6; } -if test ${ax_cv_cxx_openmp+y} -then : - printf %s "(cached) " >&6 -else $as_nop - saveCXXFLAGS=$CXXFLAGS -ax_cv_cxx_openmp=unknown -# Flags to try: -fopenmp (gcc), -mp (SGI & PGI), -# -qopenmp (icc>=15), -openmp (icc), -# -xopenmp (Sun), -omp (Tru64), -# -qsmp=omp (AIX), -# none -ax_openmp_flags="-fopenmp -openmp -qopenmp -mp -xopenmp -omp -qsmp=omp none" -if test "x$OPENMP_CXXFLAGS" != x; then - ax_openmp_flags="$OPENMP_CXXFLAGS $ax_openmp_flags" -fi -for ax_openmp_flag in $ax_openmp_flags; do - case $ax_openmp_flag in - none) CXXFLAGS=$saveCXX ;; - *) CXXFLAGS="$saveCXXFLAGS $ax_openmp_flag" ;; - esac - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include - -static void -parallel_fill(int * data, int n) -{ - int i; -#pragma omp parallel for - for (i = 0; i < n; ++i) - data[i] = i; -} - -int -main() -{ - int arr[100000]; - omp_set_num_threads(2); - parallel_fill(arr, 100000); - return 0; -} - -_ACEOF -if ac_fn_cxx_try_link "$LINENO" -then : - ax_cv_cxx_openmp=$ax_openmp_flag; break -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -done -CXXFLAGS=$saveCXXFLAGS - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cxx_openmp" >&5 -printf "%s\n" "$ax_cv_cxx_openmp" >&6; } -if test "x$ax_cv_cxx_openmp" = "xunknown"; then - : -else - if test "x$ax_cv_cxx_openmp" != "xnone"; then - OPENMP_CXXFLAGS=$ax_cv_cxx_openmp - fi - -printf "%s\n" "#define HAVE_OPENMP 1" >>confdefs.h - -fi - -if test x$OPENMP_CXXFLAGS != x -then : - HAVE_OPENMP=1 - -fi -if test x$HAVE_OPENMP != x1 -then : - -else $as_nop - CXXFLAGS="$CXXFLAGS $OPENMP_CXXFLAGS" - LDFLAGS="$LDFLAGS $OPENMP_CXXFLAGS" -fi - -ac_fn_cxx_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default" -if test "x$ac_cv_type_ptrdiff_t" = xyes -then : - -printf "%s\n" "#define HAVE_PTRDIFF_T 1" >>confdefs.h - - -fi - -ac_fn_c_find_intX_t "$LINENO" "16" "ac_cv_c_int16_t" -case $ac_cv_c_int16_t in #( - no|yes) ;; #( - *) - -printf "%s\n" "#define int16_t $ac_cv_c_int16_t" >>confdefs.h -;; -esac - -ac_fn_c_find_intX_t "$LINENO" "32" "ac_cv_c_int32_t" -case $ac_cv_c_int32_t in #( - no|yes) ;; #( - *) - -printf "%s\n" "#define int32_t $ac_cv_c_int32_t" >>confdefs.h -;; -esac - -ac_fn_c_find_intX_t "$LINENO" "64" "ac_cv_c_int64_t" -case $ac_cv_c_int64_t in #( - no|yes) ;; #( - *) - -printf "%s\n" "#define int64_t $ac_cv_c_int64_t" >>confdefs.h -;; -esac - -ac_fn_c_find_intX_t "$LINENO" "8" "ac_cv_c_int8_t" -case $ac_cv_c_int8_t in #( - no|yes) ;; #( - *) - -printf "%s\n" "#define int8_t $ac_cv_c_int8_t" >>confdefs.h -;; -esac - - - ac_fn_cxx_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default -" -if test "x$ac_cv_type_pid_t" = xyes -then : - -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - #if defined _WIN64 && !defined __CYGWIN__ - LLP64 - #endif - -int -main (void) -{ - - ; - return 0; -} - -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : - ac_pid_type='int' -else $as_nop - ac_pid_type='__int64' -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - -printf "%s\n" "#define pid_t $ac_pid_type" >>confdefs.h - - -fi - - -ac_fn_cxx_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" -if test "x$ac_cv_type_size_t" = xyes -then : - -else $as_nop - -printf "%s\n" "#define size_t unsigned int" >>confdefs.h - -fi - -ac_fn_cxx_check_type "$LINENO" "ssize_t" "ac_cv_type_ssize_t" "$ac_includes_default" -if test "x$ac_cv_type_ssize_t" = xyes -then : - -else $as_nop - -printf "%s\n" "#define ssize_t int" >>confdefs.h - -fi - -ac_fn_c_find_uintX_t "$LINENO" "16" "ac_cv_c_uint16_t" -case $ac_cv_c_uint16_t in #( - no|yes) ;; #( - *) - - -printf "%s\n" "#define uint16_t $ac_cv_c_uint16_t" >>confdefs.h -;; - esac - -ac_fn_c_find_uintX_t "$LINENO" "32" "ac_cv_c_uint32_t" -case $ac_cv_c_uint32_t in #( - no|yes) ;; #( - *) - -printf "%s\n" "#define _UINT32_T 1" >>confdefs.h - - -printf "%s\n" "#define uint32_t $ac_cv_c_uint32_t" >>confdefs.h -;; - esac - -ac_fn_c_find_uintX_t "$LINENO" "64" "ac_cv_c_uint64_t" -case $ac_cv_c_uint64_t in #( - no|yes) ;; #( - *) - -printf "%s\n" "#define _UINT64_T 1" >>confdefs.h - - -printf "%s\n" "#define uint64_t $ac_cv_c_uint64_t" >>confdefs.h -;; - esac - -ac_fn_c_find_uintX_t "$LINENO" "8" "ac_cv_c_uint8_t" -case $ac_cv_c_uint8_t in #( - no|yes) ;; #( - *) - -printf "%s\n" "#define _UINT8_T 1" >>confdefs.h - - -printf "%s\n" "#define uint8_t $ac_cv_c_uint8_t" >>confdefs.h -;; - esac - - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for long double with more range or precision than double" >&5 -printf %s "checking for long double with more range or precision than double... " >&6; } -if test ${ac_cv_type_long_double_wider+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - long double const a[] = - { - 0.0L, DBL_MIN, DBL_MAX, DBL_EPSILON, - LDBL_MIN, LDBL_MAX, LDBL_EPSILON - }; - long double - f (long double x) - { - return ((x + (unsigned long int) 10) * (-1 / x) + a[0] - + (x ? f (x) : 'c')); - } - -int -main (void) -{ -static int test_array [1 - 2 * !((0 < ((DBL_MAX_EXP < LDBL_MAX_EXP) - + (DBL_MANT_DIG < LDBL_MANT_DIG) - - (LDBL_MAX_EXP < DBL_MAX_EXP) - - (LDBL_MANT_DIG < DBL_MANT_DIG))) - && (int) LDBL_EPSILON == 0 - )]; -test_array [0] = 0; -return test_array [0]; - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : - ac_cv_type_long_double_wider=yes -else $as_nop - ac_cv_type_long_double_wider=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_double_wider" >&5 -printf "%s\n" "$ac_cv_type_long_double_wider" >&6; } - if test $ac_cv_type_long_double_wider = yes; then - -printf "%s\n" "#define HAVE_LONG_DOUBLE_WIDER 1" >>confdefs.h - - fi - -HAVE_FLOAT128=0 - -if test x$HAVE_HAVE_LONG_DOUBLE_WIDER = x1 -then : - HAVE_FLOAT128=0 - -fi - -# -# NUMA -# - -# Check whether --enable-numa was given. -if test ${enable_numa+y} -then : - enableval=$enable_numa; enable_numa=no -else $as_nop - enable_numa=yes -fi - -HAVE_NUMA=0 - -if test x$enable_numa != xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for numa_node_of_cpu in -lnuma" >&5 -printf %s "checking for numa_node_of_cpu in -lnuma... " >&6; } -if test ${ac_cv_lib_numa_numa_node_of_cpu+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-lnuma $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -namespace conftest { - extern "C" int numa_node_of_cpu (); -} -int -main (void) -{ -return conftest::numa_node_of_cpu (); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO" -then : - ac_cv_lib_numa_numa_node_of_cpu=yes -else $as_nop - ac_cv_lib_numa_numa_node_of_cpu=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_numa_numa_node_of_cpu" >&5 -printf "%s\n" "$ac_cv_lib_numa_numa_node_of_cpu" >&6; } -if test "x$ac_cv_lib_numa_numa_node_of_cpu" = xyes -then : - HAVE_NUMA=1 - - LIBS="$LIBS -lnuma" -fi - -fi - -# -# HWLOC -# - -# Check whether --enable-hwloc was given. -if test ${enable_hwloc+y} -then : - enableval=$enable_hwloc; enable_hwloc=no -else $as_nop - enable_hwloc=yes -fi - -HAVE_HWLOC=0 - -if test x$enable_hwloc != xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for hwloc_topology_init in -lhwloc" >&5 -printf %s "checking for hwloc_topology_init in -lhwloc... " >&6; } -if test ${ac_cv_lib_hwloc_hwloc_topology_init+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-lhwloc $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -namespace conftest { - extern "C" int hwloc_topology_init (); -} -int -main (void) -{ -return conftest::hwloc_topology_init (); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO" -then : - ac_cv_lib_hwloc_hwloc_topology_init=yes -else $as_nop - ac_cv_lib_hwloc_hwloc_topology_init=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hwloc_hwloc_topology_init" >&5 -printf "%s\n" "$ac_cv_lib_hwloc_hwloc_topology_init" >&6; } -if test "x$ac_cv_lib_hwloc_hwloc_topology_init" = xyes -then : - HAVE_HWLOC=1 - - LIBS="$LIBS -lhwloc" -fi - -fi - -# -# VMA -# - -# Check whether --enable-vma was given. -if test ${enable_vma+y} -then : - enableval=$enable_vma; enable_vma=yes -else $as_nop - enable_vma=no -fi - -HAVE_VMA=0 - -if test x$enable_vma != xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for recvfrom_zcopy in -lvma" >&5 -printf %s "checking for recvfrom_zcopy in -lvma... " >&6; } -if test ${ac_cv_lib_vma_recvfrom_zcopy+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-lvma $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -namespace conftest { - extern "C" int recvfrom_zcopy (); -} -int -main (void) -{ -return conftest::recvfrom_zcopy (); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO" -then : - ac_cv_lib_vma_recvfrom_zcopy=yes -else $as_nop - ac_cv_lib_vma_recvfrom_zcopy=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_vma_recvfrom_zcopy" >&5 -printf "%s\n" "$ac_cv_lib_vma_recvfrom_zcopy" >&6; } -if test "x$ac_cv_lib_vma_recvfrom_zcopy" = xyes -then : - HAVE_VMA=1 - - LIBS="$LIBS -lvma" -fi - -fi - -# -# CUDA -# - -################################# -# NOTE # -# This needs to come after all # -# other compiler/library tests # -# since it changes LIB to # -# include CUDA-specific entries # -################################# - - - - -# Check whether --with-cuda_home was given. -if test ${with_cuda_home+y} -then : - withval=$with_cuda_home; -else $as_nop - with_cuda_home=/usr/local/cuda -fi - - CUDA_HOME=$with_cuda_home - - - # Check whether --enable-cuda was given. -if test ${enable_cuda+y} -then : - enableval=$enable_cuda; enable_cuda=no -else $as_nop - enable_cuda=yes -fi - - - HAVE_CUDA=0 - - CUDA_VERSION=0 - - GPU_MAX_ARCH=0 - - if test "$enable_cuda" != "no"; then - HAVE_CUDA=1 - - - # Extract the first word of "nvcc", so it can be a program name with args. -set dummy nvcc; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_NVCC+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $NVCC in - [\\/]* | ?:[\\/]*) - ac_cv_path_NVCC="$NVCC" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -as_dummy="$CUDA_HOME/bin:$PATH" -for as_dir in $as_dummy -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_NVCC="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - test -z "$ac_cv_path_NVCC" && ac_cv_path_NVCC="no" - ;; -esac -fi -NVCC=$ac_cv_path_NVCC -if test -n "$NVCC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $NVCC" >&5 -printf "%s\n" "$NVCC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - # Extract the first word of "nvprune", so it can be a program name with args. -set dummy nvprune; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_NVPRUNE+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $NVPRUNE in - [\\/]* | ?:[\\/]*) - ac_cv_path_NVPRUNE="$NVPRUNE" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -as_dummy="$CUDA_HOME/bin:$PATH" -for as_dir in $as_dummy -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_NVPRUNE="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - test -z "$ac_cv_path_NVPRUNE" && ac_cv_path_NVPRUNE="no" - ;; -esac -fi -NVPRUNE=$ac_cv_path_NVPRUNE -if test -n "$NVPRUNE"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $NVPRUNE" >&5 -printf "%s\n" "$NVPRUNE" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - # Extract the first word of "cuobjdump", so it can be a program name with args. -set dummy cuobjdump; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_CUOBJDUMP+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $CUOBJDUMP in - [\\/]* | ?:[\\/]*) - ac_cv_path_CUOBJDUMP="$CUOBJDUMP" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -as_dummy="$CUDA_HOME/bin:$PATH" -for as_dir in $as_dummy -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_CUOBJDUMP="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - test -z "$ac_cv_path_CUOBJDUMP" && ac_cv_path_CUOBJDUMP="no" - ;; -esac -fi -CUOBJDUMP=$ac_cv_path_CUOBJDUMP -if test -n "$CUOBJDUMP"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CUOBJDUMP" >&5 -printf "%s\n" "$CUOBJDUMP" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - fi - - if test "$HAVE_CUDA" = "1"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a working CUDA installation" >&5 -printf %s "checking for a working CUDA installation... " >&6; } - - CXXFLAGS_save="$CXXFLAGS" - LDFLAGS_save="$LDFLAGS" - LIBS_save="$LIBS" - - ac_compile='$NVCC -c $NVCCFLAGS conftest.$ac_ext >&5' - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - - #include - #include -int -main (void) -{ -cudaMalloc(0, 0); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : - -else $as_nop - HAVE_CUDA=0 - -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - - if test "$HAVE_CUDA" = "1"; then - LDFLAGS="-L$CUDA_HOME/lib64 -L$CUDA_HOME/lib" - LIBS="$LIBS -lcuda -lcudart" - - ac_link='$NVCC -o conftest$ac_exeext $NVCCFLAGS $LDFLAGS $LIBS conftest.$ac_ext >&5' - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - - #include - #include -int -main (void) -{ -cudaMalloc(0, 0); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO" -then : - CUDA_VERSION=$( ${NVCC} --version | ${GREP} -Po -e "release.*," | cut -d, -f1 | cut -d\ -f2 ) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes - v$CUDA_VERSION" >&5 -printf "%s\n" "yes - v$CUDA_VERSION" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - HAVE_CUDA=0 - -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - HAVE_CUDA=0 - - fi - - CXXFLAGS="$CXXFLAGS_save" - LDFLAGS="$LDFLAGS_save" - LIBS="$LIBS_save" - fi - - -# Check whether --with-nvcc_flags was given. -if test ${with_nvcc_flags+y} -then : - withval=$with_nvcc_flags; -else $as_nop - with_nvcc_flags='-O3 -Xcompiler "-Wall"' -fi - - NVCCFLAGS=$with_nvcc_flags - - - if test "$HAVE_CUDA" = "1"; then - CPPFLAGS="$CPPFLAGS -DBF_CUDA_ENABLED=1" - CXXFLAGS="$CXXFLAGS -DBF_CUDA_ENABLED=1" - NVCCFLAGS="$NVCCFLAGS -DBF_CUDA_ENABLED=1" - LDFLAGS="$LDFLAGS -L$CUDA_HOME/lib64 -L$CUDA_HOME/lib" - LIBS="$LIBS -lcuda -lcudart -lnvrtc -lcublas -lcudadevrt -L. -lcufft_static_pruned -lculibos -lnvToolsExt" - fi - - -# Check whether --with-gpu_archs was given. -if test ${with_gpu_archs+y} -then : - withval=$with_gpu_archs; -else $as_nop - with_gpu_archs='auto' -fi - - if test "$HAVE_CUDA" = "1"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for valid CUDA architectures" >&5 -printf %s "checking for valid CUDA architectures... " >&6; } - ar_supported=$( ${NVCC} -h | ${GREP} -Po "'compute_[0-9]{2,3}" | cut -d_ -f2 | sort | uniq ) - ar_supported_flat=$( echo $ar_supported | xargs ) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: found: $ar_supported_flat" >&5 -printf "%s\n" "found: $ar_supported_flat" >&6; } - - if test "$with_gpu_archs" = "auto"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking which CUDA architectures to target" >&5 -printf %s "checking which CUDA architectures to target... " >&6; } - - CXXFLAGS_save="$CXXFLAGS" - LDFLAGS_save="$LDFLAGS" - LIBS_save="$LIBS" - - LDFLAGS="-L$CUDA_HOME/lib64 -L$CUDA_HOME/lib" - LIBS="-lcuda -lcudart" - ac_run='$NVCC -o conftest$ac_ext $LDFLAGS $LIBS conftest.$ac_ext>&5' - if test "$cross_compiling" = yes -then : - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run test program while cross compiling -See \`config.log' for more details" "$LINENO" 5; } -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - - #include - #include - #include - #include - #include -int -main (void) -{ - - std::set archs; - int major, minor, arch; - int deviceCount = 0; - cudaGetDeviceCount(&deviceCount); - if( deviceCount == 0 ) { - return 1; - } - std::ofstream fh; - fh.open("confarchs.out"); - for(int dev=0; dev 0 ) { - fh << " "; - } - fh << arch; - } - arch += minor; - if( archs.count(arch) == 0 ) { - archs.insert(arch); - fh << " " << arch; - } - } - fh.close(); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_run "$LINENO" -then : - GPU_ARCHS=`cat confarchs.out` - - ar_supported=$( ${NVCC} -h | ${GREP} -Po "'compute_[0-9]{2,3}" | cut -d_ -f2 | sort | uniq ) - ar_valid=$( echo $GPU_ARCHS $ar_supported | xargs -n1 | sort | uniq -d | xargs ) - if test "$ar_valid" = ""; then - as_fn_error $? "failed to find any supported" "$LINENO" 5 - else - GPU_ARCHS=$ar_valid - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $GPU_ARCHS" >&5 -printf "%s\n" "$GPU_ARCHS" >&6; } - fi -else $as_nop - as_fn_error $? "failed to find any" "$LINENO" 5 -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - - - CXXFLAGS="$CXXFLAGS_save" - LDFLAGS="$LDFLAGS_save" - LIBS="$LIBS_save" - else - GPU_ARCHS=$with_gpu_archs - - fi - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for valid requested CUDA architectures" >&5 -printf %s "checking for valid requested CUDA architectures... " >&6; } - ar_requested=$( echo "$GPU_ARCHS" | wc -w ) - ar_valid=$( echo $GPU_ARCHS $ar_supported | xargs -n1 | sort | uniq -d | xargs ) - ar_found=$( echo $ar_valid | wc -w ) - if test "$ar_requested" = "$ar_found"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } - else - as_fn_error $? "only '$ar_valid' are supported" "$LINENO" 5 - fi - - ar_max_valid=$(echo $ar_valid | ${SED} -e 's/.* //g;' ) - GPU_MAX_ARCH=$ar_max_valid - - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Pascal-style CUDA managed memory" >&5 -printf %s "checking for Pascal-style CUDA managed memory... " >&6; } - cm_invalid=$( echo $GPU_ARCHS | ${SED} -e 's/\b[1-5][0-9]\b/PRE/g;' ) - if ! echo $cm_invalid | ${GREP} -q PRE; then - GPU_PASCAL_MANAGEDMEM=1 - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } - else - GPU_PASCAL_MANAGEDMEM=0 - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - fi - else - GPU_PASCAL_MANAGEDMEM=0 - - fi - - - -# Check whether --with-shared_mem was given. -if test ${with_shared_mem+y} -then : - withval=$with_shared_mem; -else $as_nop - with_shared_mem=16384 -fi - -GPU_SHAREDMEM=$with_shared_mem - -if test x$HAVE_CUDA = x0 -then : - GPU_SHAREDMEM=0 - -fi - -# -# Bifrost memory alignment -# - - -# Check whether --with-alignment was given. -if test ${with_alignment+y} -then : - withval=$with_alignment; -else $as_nop - with_alignment=4096 -fi - -ALIGNMENT=$with_alignment - - -# -# Bifrost proclog location -# - - - - - -# Check whether --with-logging_dir was given. -if test ${with_logging_dir+y} -then : - withval=$with_logging_dir; HAVE_TMPFS=$with_logging_dir - -else $as_nop - HAVE_TMPFS=/tmp - -fi - - - if test "$HAVE_TMPFS" = "/tmp"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for /dev/shm" >&5 -printf %s "checking for /dev/shm... " >&6; } -if test ${ac_cv_file__dev_shm+y} -then : - printf %s "(cached) " >&6 -else $as_nop - test "$cross_compiling" = yes && - as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 -if test -r "/dev/shm"; then - ac_cv_file__dev_shm=yes -else - ac_cv_file__dev_shm=no -fi -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__dev_shm" >&5 -printf "%s\n" "$ac_cv_file__dev_shm" >&6; } -if test "x$ac_cv_file__dev_shm" = xyes -then : - HAVE_TMPFS=/dev/shm/bifrost - -fi - - fi - - if test "$HAVE_TMPFS" = "/tmp"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for /Volumes/RAMDisk" >&5 -printf %s "checking for /Volumes/RAMDisk... " >&6; } -if test ${ac_cv_file__Volumes_RAMDisk+y} -then : - printf %s "(cached) " >&6 -else $as_nop - test "$cross_compiling" = yes && - as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 -if test -r "/Volumes/RAMDisk"; then - ac_cv_file__Volumes_RAMDisk=yes -else - ac_cv_file__Volumes_RAMDisk=no -fi -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__Volumes_RAMDisk" >&5 -printf "%s\n" "$ac_cv_file__Volumes_RAMDisk" >&6; } -if test "x$ac_cv_file__Volumes_RAMDisk" = xyes -then : - HAVE_TMPFS=/Volumes/RAMDisk/bifrost - -fi - - fi - - if test "$HAVE_TMPFS" = "/tmp"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for /tmp" >&5 -printf %s "checking for /tmp... " >&6; } -if test ${ac_cv_file__tmp+y} -then : - printf %s "(cached) " >&6 -else $as_nop - test "$cross_compiling" = yes && - as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 -if test -r "/tmp"; then - ac_cv_file__tmp=yes -else - ac_cv_file__tmp=no -fi -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__tmp" >&5 -printf "%s\n" "$ac_cv_file__tmp" >&6; } -if test "x$ac_cv_file__tmp" = xyes -then : - HAVE_TMPFS=/tmp - -fi - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $HAVE_TMPFS may have performance problems for logging" >&5 -printf "%s\n" "$as_me: WARNING: $HAVE_TMPFS may have performance problems for logging" >&2;} - HAVE_TMPFS=/tmp/bifrost - - fi - - -# -# Bifrost Features -# - -# Check whether --enable-debug was given. -if test ${enable_debug+y} -then : - enableval=$enable_debug; enable_debug=yes -else $as_nop - enable_debug=no -fi - -HAVE_DEBUG=0 - -if test x$enable_debug != xno -then : - HAVE_DEBUG=1 - - CXXFLAGS="$CXXFLAGS -g" - NVCCFLAGS="$NVCCFLAGS -g" -fi - -# Check whether --enable-trace was given. -if test ${enable_trace+y} -then : - enableval=$enable_trace; enable_trace=yes -else $as_nop - enable_trace=no -fi - -HAVE_TRACE=0 - -if test x$enable_trace != xno -then : - HAVE_TRACE=1 - -fi - - - - # Check whether --enable-native_arch was given. -if test ${enable_native_arch+y} -then : - enableval=$enable_native_arch; enable_native_arch=no -else $as_nop - enable_native_arch=yes -fi - - - if test "$enable_native_arch" = "yes"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the compiler accepts '-march=native'" >&5 -printf %s "checking if the compiler accepts '-march=native'... " >&6; } - - CXXFLAGS_temp="$CXXFLAGS -march=native" - - ac_compile='$CXX -c $CXXFLAGS_temp conftest.$ac_ext >&5' - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - - -int -main (void) -{ - - int i = 5; - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : - CXXFLAGS="$CXXFLAGS -march=native" - NVCCFLAGS="$NVCCFLAGS -Xcompiler \"-march=native\"" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } -else $as_nop - enable_native_arch=no - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - fi - - -# Check whether --enable-cuda_debug was given. -if test ${enable_cuda_debug+y} -then : - enableval=$enable_cuda_debug; enable_cuda_debug=yes -else $as_nop - enable_cuda_debug=no -fi - -HAVE_CUDA_DEBUG=0 - -if test x$enable_cuda_debug != xno -then : - HAVE_CUDA_DEBUG=1 - - NVCCFLAGS="$NVCCFLAGS -G" -fi - - - -# Check whether --with-mapped_ring_dir was given. -if test ${with_mapped_ring_dir+y} -then : - withval=$with_mapped_ring_dir; -else $as_nop - mapped_ring_dir=/tmp/bifrost -fi - -MAPPED_RING_DIR=$mapped_ring_dir - - -# -# Python -# - -# Check whether --enable-python was given. -if test ${enable_python+y} -then : - enableval=$enable_python; enable_python=no -else $as_nop - enable_python=yes -fi - -HAVE_PYTHON=0 - -if test x$enable_python != xno -then : - - - - - - - - - - - if test -z "$PYTHON" -then : - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether python executable path has been provided" >&5 -printf %s "checking whether python executable path has been provided... " >&6; } - -# Check whether --with-python was given. -if test ${with_python+y} -then : - withval=$with_python; - if test "$withval" != yes && test "$withval" != no -then : - - PYTHON="$withval" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5 -printf "%s\n" "$PYTHON" >&6; } - -else $as_nop - - PYTHON="" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - if test "$withval" != no -then : - - # Extract the first word of "python", so it can be a program name with args. -set dummy python; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_PYTHON+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $PYTHON in - [\\/]* | ?:[\\/]*) - ac_cv_path_PYTHON="$PYTHON" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_PYTHON="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - test -z "$ac_cv_path_PYTHON" && ac_cv_path_PYTHON="no" - ;; -esac -fi -PYTHON=$ac_cv_path_PYTHON -if test -n "$PYTHON"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5 -printf "%s\n" "$PYTHON" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - -fi - -fi - -else $as_nop - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - # Extract the first word of "python", so it can be a program name with args. -set dummy python; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_PYTHON+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $PYTHON in - [\\/]* | ?:[\\/]*) - ac_cv_path_PYTHON="$PYTHON" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_PYTHON="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - test -z "$ac_cv_path_PYTHON" && ac_cv_path_PYTHON="no" - ;; -esac -fi -PYTHON=$ac_cv_path_PYTHON -if test -n "$PYTHON"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5 -printf "%s\n" "$PYTHON" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - -fi - - -fi - - - - - - - if test x${PYTHON} != xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $PYTHON as ctypesgen" >&5 -printf %s "checking whether $PYTHON as ctypesgen... " >&6; } - if ! ${PYTHON} -c "import ctypesgen" 2>/dev/null -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: python module will not be built" >&5 -printf "%s\n" "$as_me: WARNING: python module will not be built" >&2;} -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } - HAVE_PYTHON=1 - -fi -fi -fi - -# Check whether --with-pybuild_flags was given. -if test ${with_pybuild_flags+y} -then : - withval=$with_pybuild_flags; -fi - -PYBUILDFLAGS=$with_pybuild_flags - - - -# Check whether --with-pyinstall_flags was given. -if test ${with_pyinstall_flags+y} -then : - withval=$with_pyinstall_flags; -fi - -PYINSTALLFLAGS=$with_pyinstall_flags - - -# -# Docker -# - - - - - - - - - - - - if test -z "$DOCKER" -then : - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether docker executable path has been provided" >&5 -printf %s "checking whether docker executable path has been provided... " >&6; } - -# Check whether --with-docker was given. -if test ${with_docker+y} -then : - withval=$with_docker; - if test "$withval" != yes && test "$withval" != no -then : - - DOCKER="$withval" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DOCKER" >&5 -printf "%s\n" "$DOCKER" >&6; } - -else $as_nop - - DOCKER="" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - if test "$withval" != no -then : - - # Extract the first word of "docker", so it can be a program name with args. -set dummy docker; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_DOCKER+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $DOCKER in - [\\/]* | ?:[\\/]*) - ac_cv_path_DOCKER="$DOCKER" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_DOCKER="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - test -z "$ac_cv_path_DOCKER" && ac_cv_path_DOCKER="no" - ;; -esac -fi -DOCKER=$ac_cv_path_DOCKER -if test -n "$DOCKER"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DOCKER" >&5 -printf "%s\n" "$DOCKER" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - -fi - -fi - -else $as_nop - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - # Extract the first word of "docker", so it can be a program name with args. -set dummy docker; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_DOCKER+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $DOCKER in - [\\/]* | ?:[\\/]*) - ac_cv_path_DOCKER="$DOCKER" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_DOCKER="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - test -z "$ac_cv_path_DOCKER" && ac_cv_path_DOCKER="no" - ;; -esac -fi -DOCKER=$ac_cv_path_DOCKER -if test -n "$DOCKER"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DOCKER" >&5 -printf "%s\n" "$DOCKER" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - -fi - - -fi - - - - - - -if test x${DOCKER} != xno -then : - HAVE_DOCKER=1 - -fi - -# -# Documentation -# - - - - - - - - - - - - -# Files: -DX_PROJECT=bifrost - -DX_CONFIG='$(srcdir)/Doxyfile' - -DX_DOCDIR='doxygen-doc' - - -# Environment variables used inside doxygen.cfg: -DX_ENV="$DX_ENV SRCDIR='$srcdir'" -SRCDIR=$srcdir - -DX_ENV="$DX_ENV PROJECT='$DX_PROJECT'" -PROJECT=$DX_PROJECT - -DX_ENV="$DX_ENV VERSION='$PACKAGE_VERSION'" - - -# Doxygen itself: - - - - # Check whether --enable-doxygen-doc was given. -if test ${enable_doxygen_doc+y} -then : - enableval=$enable_doxygen_doc; -case "$enableval" in -#( -y|Y|yes|Yes|YES) - DX_FLAG_doc=1 - - -;; #( -n|N|no|No|NO) - DX_FLAG_doc=0 - -;; #( -*) - as_fn_error $? "invalid value '$enableval' given to doxygen-doc" "$LINENO" 5 -;; -esac - -else $as_nop - -DX_FLAG_doc=1 - - - -fi - -if test "$DX_FLAG_doc" = 1; then - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}doxygen", so it can be a program name with args. -set dummy ${ac_tool_prefix}doxygen; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_DX_DOXYGEN+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $DX_DOXYGEN in - [\\/]* | ?:[\\/]*) - ac_cv_path_DX_DOXYGEN="$DX_DOXYGEN" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_DX_DOXYGEN="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -DX_DOXYGEN=$ac_cv_path_DX_DOXYGEN -if test -n "$DX_DOXYGEN"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DX_DOXYGEN" >&5 -printf "%s\n" "$DX_DOXYGEN" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - -fi -if test -z "$ac_cv_path_DX_DOXYGEN"; then - ac_pt_DX_DOXYGEN=$DX_DOXYGEN - # Extract the first word of "doxygen", so it can be a program name with args. -set dummy doxygen; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_ac_pt_DX_DOXYGEN+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $ac_pt_DX_DOXYGEN in - [\\/]* | ?:[\\/]*) - ac_cv_path_ac_pt_DX_DOXYGEN="$ac_pt_DX_DOXYGEN" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_DX_DOXYGEN="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -ac_pt_DX_DOXYGEN=$ac_cv_path_ac_pt_DX_DOXYGEN -if test -n "$ac_pt_DX_DOXYGEN"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_DOXYGEN" >&5 -printf "%s\n" "$ac_pt_DX_DOXYGEN" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - if test "x$ac_pt_DX_DOXYGEN" = x; then - DX_DOXYGEN="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - DX_DOXYGEN=$ac_pt_DX_DOXYGEN - fi -else - DX_DOXYGEN="$ac_cv_path_DX_DOXYGEN" -fi - -if test "$DX_FLAG_doc$DX_DOXYGEN" = 1; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: doxygen not found - will not generate any doxygen documentation" >&5 -printf "%s\n" "$as_me: WARNING: doxygen not found - will not generate any doxygen documentation" >&2;} - DX_FLAG_doc=0 - -fi - - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}perl", so it can be a program name with args. -set dummy ${ac_tool_prefix}perl; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_DX_PERL+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $DX_PERL in - [\\/]* | ?:[\\/]*) - ac_cv_path_DX_PERL="$DX_PERL" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_DX_PERL="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -DX_PERL=$ac_cv_path_DX_PERL -if test -n "$DX_PERL"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DX_PERL" >&5 -printf "%s\n" "$DX_PERL" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - -fi -if test -z "$ac_cv_path_DX_PERL"; then - ac_pt_DX_PERL=$DX_PERL - # Extract the first word of "perl", so it can be a program name with args. -set dummy perl; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_ac_pt_DX_PERL+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $ac_pt_DX_PERL in - [\\/]* | ?:[\\/]*) - ac_cv_path_ac_pt_DX_PERL="$ac_pt_DX_PERL" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_DX_PERL="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -ac_pt_DX_PERL=$ac_cv_path_ac_pt_DX_PERL -if test -n "$ac_pt_DX_PERL"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_PERL" >&5 -printf "%s\n" "$ac_pt_DX_PERL" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - if test "x$ac_pt_DX_PERL" = x; then - DX_PERL="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - DX_PERL=$ac_pt_DX_PERL - fi -else - DX_PERL="$ac_cv_path_DX_PERL" -fi - -if test "$DX_FLAG_doc$DX_PERL" = 1; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: perl not found - will not generate any doxygen documentation" >&5 -printf "%s\n" "$as_me: WARNING: perl not found - will not generate any doxygen documentation" >&2;} - DX_FLAG_doc=0 - -fi - - : -fi -if test "$DX_FLAG_doc" = 1; then - DX_ENV="$DX_ENV PERL_PATH='$DX_PERL'" -PERL_PATH=$DX_PERL - - : -else - - : -fi - - -# Dot for graphics: - - - - # Check whether --enable-doxygen-dot was given. -if test ${enable_doxygen_dot+y} -then : - enableval=$enable_doxygen_dot; -case "$enableval" in -#( -y|Y|yes|Yes|YES) - DX_FLAG_dot=1 - - -test "$DX_FLAG_doc" = "1" \ -|| as_fn_error $? "doxygen-dot requires doxygen-doc" "$LINENO" 5 - -;; #( -n|N|no|No|NO) - DX_FLAG_dot=0 - -;; #( -*) - as_fn_error $? "invalid value '$enableval' given to doxygen-dot" "$LINENO" 5 -;; -esac - -else $as_nop - -DX_FLAG_dot=0 - - -test "$DX_FLAG_doc" = "1" || DX_FLAG_dot=0 - - - -fi - -if test "$DX_FLAG_dot" = 1; then - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}dot", so it can be a program name with args. -set dummy ${ac_tool_prefix}dot; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_DX_DOT+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $DX_DOT in - [\\/]* | ?:[\\/]*) - ac_cv_path_DX_DOT="$DX_DOT" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_DX_DOT="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -DX_DOT=$ac_cv_path_DX_DOT -if test -n "$DX_DOT"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DX_DOT" >&5 -printf "%s\n" "$DX_DOT" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - -fi -if test -z "$ac_cv_path_DX_DOT"; then - ac_pt_DX_DOT=$DX_DOT - # Extract the first word of "dot", so it can be a program name with args. -set dummy dot; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_ac_pt_DX_DOT+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $ac_pt_DX_DOT in - [\\/]* | ?:[\\/]*) - ac_cv_path_ac_pt_DX_DOT="$ac_pt_DX_DOT" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_DX_DOT="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -ac_pt_DX_DOT=$ac_cv_path_ac_pt_DX_DOT -if test -n "$ac_pt_DX_DOT"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_DOT" >&5 -printf "%s\n" "$ac_pt_DX_DOT" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - if test "x$ac_pt_DX_DOT" = x; then - DX_DOT="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - DX_DOT=$ac_pt_DX_DOT - fi -else - DX_DOT="$ac_cv_path_DX_DOT" -fi - -if test "$DX_FLAG_dot$DX_DOT" = 1; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: dot not found - will not generate graphics for doxygen documentation" >&5 -printf "%s\n" "$as_me: WARNING: dot not found - will not generate graphics for doxygen documentation" >&2;} - DX_FLAG_dot=0 - -fi - - : -fi -if test "$DX_FLAG_dot" = 1; then - DX_ENV="$DX_ENV HAVE_DOT='YES'" -HAVE_DOT=YES - - DX_ENV="$DX_ENV DOT_PATH='`expr ".$DX_DOT" : '\(\.\)[^/]*$' \| "x$DX_DOT" : 'x\(.*\)/[^/]*$'`'" -DOT_PATH=`expr ".$DX_DOT" : '\(\.\)[^/]*$' \| "x$DX_DOT" : 'x\(.*\)/[^/]*$'` - - : -else - DX_ENV="$DX_ENV HAVE_DOT='NO'" -HAVE_DOT=NO - - : -fi - - -# Man pages generation: - - - - # Check whether --enable-doxygen-man was given. -if test ${enable_doxygen_man+y} -then : - enableval=$enable_doxygen_man; -case "$enableval" in -#( -y|Y|yes|Yes|YES) - DX_FLAG_man=1 - - -test "$DX_FLAG_doc" = "1" \ -|| as_fn_error $? "doxygen-man requires doxygen-doc" "$LINENO" 5 - -;; #( -n|N|no|No|NO) - DX_FLAG_man=0 - -;; #( -*) - as_fn_error $? "invalid value '$enableval' given to doxygen-man" "$LINENO" 5 -;; -esac - -else $as_nop - -DX_FLAG_man=1 - - -test "$DX_FLAG_doc" = "1" || DX_FLAG_man=0 - - - -fi - -if test "$DX_FLAG_man" = 1; then - - : -fi -if test "$DX_FLAG_man" = 1; then - DX_ENV="$DX_ENV GENERATE_MAN='YES'" -GENERATE_MAN=YES - - : -else - DX_ENV="$DX_ENV GENERATE_MAN='NO'" -GENERATE_MAN=NO - - : -fi - - -# RTF file generation: - - - - # Check whether --enable-doxygen-rtf was given. -if test ${enable_doxygen_rtf+y} -then : - enableval=$enable_doxygen_rtf; -case "$enableval" in -#( -y|Y|yes|Yes|YES) - DX_FLAG_rtf=1 - - -test "$DX_FLAG_doc" = "1" \ -|| as_fn_error $? "doxygen-rtf requires doxygen-doc" "$LINENO" 5 - -;; #( -n|N|no|No|NO) - DX_FLAG_rtf=0 - -;; #( -*) - as_fn_error $? "invalid value '$enableval' given to doxygen-rtf" "$LINENO" 5 -;; -esac - -else $as_nop - -DX_FLAG_rtf=0 - - -test "$DX_FLAG_doc" = "1" || DX_FLAG_rtf=0 - - - -fi - -if test "$DX_FLAG_rtf" = 1; then - - : -fi -if test "$DX_FLAG_rtf" = 1; then - DX_ENV="$DX_ENV GENERATE_RTF='YES'" -GENERATE_RTF=YES - - : -else - DX_ENV="$DX_ENV GENERATE_RTF='NO'" -GENERATE_RTF=NO - - : -fi - - -# XML file generation: - - - - # Check whether --enable-doxygen-xml was given. -if test ${enable_doxygen_xml+y} -then : - enableval=$enable_doxygen_xml; -case "$enableval" in -#( -y|Y|yes|Yes|YES) - DX_FLAG_xml=1 - - -test "$DX_FLAG_doc" = "1" \ -|| as_fn_error $? "doxygen-xml requires doxygen-doc" "$LINENO" 5 - -;; #( -n|N|no|No|NO) - DX_FLAG_xml=0 - -;; #( -*) - as_fn_error $? "invalid value '$enableval' given to doxygen-xml" "$LINENO" 5 -;; -esac - -else $as_nop - -DX_FLAG_xml=0 - - -test "$DX_FLAG_doc" = "1" || DX_FLAG_xml=0 - - - -fi - -if test "$DX_FLAG_xml" = 1; then - - : -fi -if test "$DX_FLAG_xml" = 1; then - DX_ENV="$DX_ENV GENERATE_XML='YES'" -GENERATE_XML=YES - - : -else - DX_ENV="$DX_ENV GENERATE_XML='NO'" -GENERATE_XML=NO - - : -fi - - -# (Compressed) HTML help generation: - - - - # Check whether --enable-doxygen-chm was given. -if test ${enable_doxygen_chm+y} -then : - enableval=$enable_doxygen_chm; -case "$enableval" in -#( -y|Y|yes|Yes|YES) - DX_FLAG_chm=1 - - -test "$DX_FLAG_doc" = "1" \ -|| as_fn_error $? "doxygen-chm requires doxygen-doc" "$LINENO" 5 - -;; #( -n|N|no|No|NO) - DX_FLAG_chm=0 - -;; #( -*) - as_fn_error $? "invalid value '$enableval' given to doxygen-chm" "$LINENO" 5 -;; -esac - -else $as_nop - -DX_FLAG_chm=0 - - -test "$DX_FLAG_doc" = "1" || DX_FLAG_chm=0 - - - -fi - -if test "$DX_FLAG_chm" = 1; then - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}hhc", so it can be a program name with args. -set dummy ${ac_tool_prefix}hhc; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_DX_HHC+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $DX_HHC in - [\\/]* | ?:[\\/]*) - ac_cv_path_DX_HHC="$DX_HHC" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_DX_HHC="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -DX_HHC=$ac_cv_path_DX_HHC -if test -n "$DX_HHC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DX_HHC" >&5 -printf "%s\n" "$DX_HHC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - -fi -if test -z "$ac_cv_path_DX_HHC"; then - ac_pt_DX_HHC=$DX_HHC - # Extract the first word of "hhc", so it can be a program name with args. -set dummy hhc; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_ac_pt_DX_HHC+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $ac_pt_DX_HHC in - [\\/]* | ?:[\\/]*) - ac_cv_path_ac_pt_DX_HHC="$ac_pt_DX_HHC" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_DX_HHC="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -ac_pt_DX_HHC=$ac_cv_path_ac_pt_DX_HHC -if test -n "$ac_pt_DX_HHC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_HHC" >&5 -printf "%s\n" "$ac_pt_DX_HHC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - if test "x$ac_pt_DX_HHC" = x; then - DX_HHC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - DX_HHC=$ac_pt_DX_HHC - fi -else - DX_HHC="$ac_cv_path_DX_HHC" -fi - -if test "$DX_FLAG_chm$DX_HHC" = 1; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: hhc not found - will not generate doxygen compressed HTML help documentation" >&5 -printf "%s\n" "$as_me: WARNING: hhc not found - will not generate doxygen compressed HTML help documentation" >&2;} - DX_FLAG_chm=0 - -fi - - : -fi -if test "$DX_FLAG_chm" = 1; then - DX_ENV="$DX_ENV HHC_PATH='$DX_HHC'" -HHC_PATH=$DX_HHC - - DX_ENV="$DX_ENV GENERATE_HTML='YES'" -GENERATE_HTML=YES - - DX_ENV="$DX_ENV GENERATE_HTMLHELP='YES'" -GENERATE_HTMLHELP=YES - - : -else - DX_ENV="$DX_ENV GENERATE_HTMLHELP='NO'" -GENERATE_HTMLHELP=NO - - : -fi - - -# Separate CHI file generation. - - - - # Check whether --enable-doxygen-chi was given. -if test ${enable_doxygen_chi+y} -then : - enableval=$enable_doxygen_chi; -case "$enableval" in -#( -y|Y|yes|Yes|YES) - DX_FLAG_chi=1 - - -test "$DX_FLAG_chm" = "1" \ -|| as_fn_error $? "doxygen-chi requires doxygen-chm" "$LINENO" 5 - -;; #( -n|N|no|No|NO) - DX_FLAG_chi=0 - -;; #( -*) - as_fn_error $? "invalid value '$enableval' given to doxygen-chi" "$LINENO" 5 -;; -esac - -else $as_nop - -DX_FLAG_chi=0 - - -test "$DX_FLAG_chm" = "1" || DX_FLAG_chi=0 - - - -fi - -if test "$DX_FLAG_chi" = 1; then - - : -fi -if test "$DX_FLAG_chi" = 1; then - DX_ENV="$DX_ENV GENERATE_CHI='YES'" -GENERATE_CHI=YES - - : -else - DX_ENV="$DX_ENV GENERATE_CHI='NO'" -GENERATE_CHI=NO - - : -fi - - -# Plain HTML pages generation: - - - - # Check whether --enable-doxygen-html was given. -if test ${enable_doxygen_html+y} -then : - enableval=$enable_doxygen_html; -case "$enableval" in -#( -y|Y|yes|Yes|YES) - DX_FLAG_html=1 - - -test "$DX_FLAG_doc" = "1" \ -|| as_fn_error $? "doxygen-html requires doxygen-doc" "$LINENO" 5 - -test "$DX_FLAG_chm" = "0" \ -|| as_fn_error $? "doxygen-html contradicts doxygen-chm" "$LINENO" 5 - -;; #( -n|N|no|No|NO) - DX_FLAG_html=0 - -;; #( -*) - as_fn_error $? "invalid value '$enableval' given to doxygen-html" "$LINENO" 5 -;; -esac - -else $as_nop - -DX_FLAG_html=1 - - -test "$DX_FLAG_doc" = "1" || DX_FLAG_html=0 - - -test "$DX_FLAG_chm" = "0" || DX_FLAG_html=0 - - - -fi - -if test "$DX_FLAG_html" = 1; then - - : -fi -if test "$DX_FLAG_html" = 1; then - DX_ENV="$DX_ENV GENERATE_HTML='YES'" -GENERATE_HTML=YES - - : -else - test "$DX_FLAG_chm" = 1 || DX_ENV="$DX_ENV GENERATE_HTML='NO'" -GENERATE_HTML=NO - - : -fi - - -# PostScript file generation: - - - - # Check whether --enable-doxygen-ps was given. -if test ${enable_doxygen_ps+y} -then : - enableval=$enable_doxygen_ps; -case "$enableval" in -#( -y|Y|yes|Yes|YES) - DX_FLAG_ps=1 - - -test "$DX_FLAG_doc" = "1" \ -|| as_fn_error $? "doxygen-ps requires doxygen-doc" "$LINENO" 5 - -;; #( -n|N|no|No|NO) - DX_FLAG_ps=0 - -;; #( -*) - as_fn_error $? "invalid value '$enableval' given to doxygen-ps" "$LINENO" 5 -;; -esac - -else $as_nop - -DX_FLAG_ps=1 - - -test "$DX_FLAG_doc" = "1" || DX_FLAG_ps=0 - - - -fi - -if test "$DX_FLAG_ps" = 1; then - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}latex", so it can be a program name with args. -set dummy ${ac_tool_prefix}latex; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_DX_LATEX+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $DX_LATEX in - [\\/]* | ?:[\\/]*) - ac_cv_path_DX_LATEX="$DX_LATEX" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_DX_LATEX="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -DX_LATEX=$ac_cv_path_DX_LATEX -if test -n "$DX_LATEX"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DX_LATEX" >&5 -printf "%s\n" "$DX_LATEX" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - -fi -if test -z "$ac_cv_path_DX_LATEX"; then - ac_pt_DX_LATEX=$DX_LATEX - # Extract the first word of "latex", so it can be a program name with args. -set dummy latex; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_ac_pt_DX_LATEX+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $ac_pt_DX_LATEX in - [\\/]* | ?:[\\/]*) - ac_cv_path_ac_pt_DX_LATEX="$ac_pt_DX_LATEX" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_DX_LATEX="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -ac_pt_DX_LATEX=$ac_cv_path_ac_pt_DX_LATEX -if test -n "$ac_pt_DX_LATEX"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_LATEX" >&5 -printf "%s\n" "$ac_pt_DX_LATEX" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - if test "x$ac_pt_DX_LATEX" = x; then - DX_LATEX="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - DX_LATEX=$ac_pt_DX_LATEX - fi -else - DX_LATEX="$ac_cv_path_DX_LATEX" -fi - -if test "$DX_FLAG_ps$DX_LATEX" = 1; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: latex not found - will not generate doxygen PostScript documentation" >&5 -printf "%s\n" "$as_me: WARNING: latex not found - will not generate doxygen PostScript documentation" >&2;} - DX_FLAG_ps=0 - -fi - - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}makeindex", so it can be a program name with args. -set dummy ${ac_tool_prefix}makeindex; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_DX_MAKEINDEX+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $DX_MAKEINDEX in - [\\/]* | ?:[\\/]*) - ac_cv_path_DX_MAKEINDEX="$DX_MAKEINDEX" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_DX_MAKEINDEX="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -DX_MAKEINDEX=$ac_cv_path_DX_MAKEINDEX -if test -n "$DX_MAKEINDEX"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DX_MAKEINDEX" >&5 -printf "%s\n" "$DX_MAKEINDEX" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - -fi -if test -z "$ac_cv_path_DX_MAKEINDEX"; then - ac_pt_DX_MAKEINDEX=$DX_MAKEINDEX - # Extract the first word of "makeindex", so it can be a program name with args. -set dummy makeindex; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_ac_pt_DX_MAKEINDEX+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $ac_pt_DX_MAKEINDEX in - [\\/]* | ?:[\\/]*) - ac_cv_path_ac_pt_DX_MAKEINDEX="$ac_pt_DX_MAKEINDEX" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_DX_MAKEINDEX="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -ac_pt_DX_MAKEINDEX=$ac_cv_path_ac_pt_DX_MAKEINDEX -if test -n "$ac_pt_DX_MAKEINDEX"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_MAKEINDEX" >&5 -printf "%s\n" "$ac_pt_DX_MAKEINDEX" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - if test "x$ac_pt_DX_MAKEINDEX" = x; then - DX_MAKEINDEX="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - DX_MAKEINDEX=$ac_pt_DX_MAKEINDEX - fi -else - DX_MAKEINDEX="$ac_cv_path_DX_MAKEINDEX" -fi - -if test "$DX_FLAG_ps$DX_MAKEINDEX" = 1; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: makeindex not found - will not generate doxygen PostScript documentation" >&5 -printf "%s\n" "$as_me: WARNING: makeindex not found - will not generate doxygen PostScript documentation" >&2;} - DX_FLAG_ps=0 - -fi - - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}dvips", so it can be a program name with args. -set dummy ${ac_tool_prefix}dvips; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_DX_DVIPS+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $DX_DVIPS in - [\\/]* | ?:[\\/]*) - ac_cv_path_DX_DVIPS="$DX_DVIPS" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_DX_DVIPS="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -DX_DVIPS=$ac_cv_path_DX_DVIPS -if test -n "$DX_DVIPS"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DX_DVIPS" >&5 -printf "%s\n" "$DX_DVIPS" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - -fi -if test -z "$ac_cv_path_DX_DVIPS"; then - ac_pt_DX_DVIPS=$DX_DVIPS - # Extract the first word of "dvips", so it can be a program name with args. -set dummy dvips; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_ac_pt_DX_DVIPS+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $ac_pt_DX_DVIPS in - [\\/]* | ?:[\\/]*) - ac_cv_path_ac_pt_DX_DVIPS="$ac_pt_DX_DVIPS" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_DX_DVIPS="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -ac_pt_DX_DVIPS=$ac_cv_path_ac_pt_DX_DVIPS -if test -n "$ac_pt_DX_DVIPS"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_DVIPS" >&5 -printf "%s\n" "$ac_pt_DX_DVIPS" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - if test "x$ac_pt_DX_DVIPS" = x; then - DX_DVIPS="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - DX_DVIPS=$ac_pt_DX_DVIPS - fi -else - DX_DVIPS="$ac_cv_path_DX_DVIPS" -fi - -if test "$DX_FLAG_ps$DX_DVIPS" = 1; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: dvips not found - will not generate doxygen PostScript documentation" >&5 -printf "%s\n" "$as_me: WARNING: dvips not found - will not generate doxygen PostScript documentation" >&2;} - DX_FLAG_ps=0 - -fi - - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}egrep", so it can be a program name with args. -set dummy ${ac_tool_prefix}egrep; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_DX_EGREP+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $DX_EGREP in - [\\/]* | ?:[\\/]*) - ac_cv_path_DX_EGREP="$DX_EGREP" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_DX_EGREP="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -DX_EGREP=$ac_cv_path_DX_EGREP -if test -n "$DX_EGREP"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DX_EGREP" >&5 -printf "%s\n" "$DX_EGREP" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - -fi -if test -z "$ac_cv_path_DX_EGREP"; then - ac_pt_DX_EGREP=$DX_EGREP - # Extract the first word of "egrep", so it can be a program name with args. -set dummy egrep; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_ac_pt_DX_EGREP+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $ac_pt_DX_EGREP in - [\\/]* | ?:[\\/]*) - ac_cv_path_ac_pt_DX_EGREP="$ac_pt_DX_EGREP" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_DX_EGREP="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -ac_pt_DX_EGREP=$ac_cv_path_ac_pt_DX_EGREP -if test -n "$ac_pt_DX_EGREP"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_EGREP" >&5 -printf "%s\n" "$ac_pt_DX_EGREP" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - if test "x$ac_pt_DX_EGREP" = x; then - DX_EGREP="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - DX_EGREP=$ac_pt_DX_EGREP - fi -else - DX_EGREP="$ac_cv_path_DX_EGREP" -fi - -if test "$DX_FLAG_ps$DX_EGREP" = 1; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: egrep not found - will not generate doxygen PostScript documentation" >&5 -printf "%s\n" "$as_me: WARNING: egrep not found - will not generate doxygen PostScript documentation" >&2;} - DX_FLAG_ps=0 - -fi - - : -fi -if test "$DX_FLAG_ps" = 1; then - - : -else - - : -fi - - -# PDF file generation: - - - - # Check whether --enable-doxygen-pdf was given. -if test ${enable_doxygen_pdf+y} -then : - enableval=$enable_doxygen_pdf; -case "$enableval" in -#( -y|Y|yes|Yes|YES) - DX_FLAG_pdf=1 - - -test "$DX_FLAG_doc" = "1" \ -|| as_fn_error $? "doxygen-pdf requires doxygen-doc" "$LINENO" 5 - -;; #( -n|N|no|No|NO) - DX_FLAG_pdf=0 - -;; #( -*) - as_fn_error $? "invalid value '$enableval' given to doxygen-pdf" "$LINENO" 5 -;; -esac - -else $as_nop - -DX_FLAG_pdf=1 - - -test "$DX_FLAG_doc" = "1" || DX_FLAG_pdf=0 - - - -fi - -if test "$DX_FLAG_pdf" = 1; then - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}pdflatex", so it can be a program name with args. -set dummy ${ac_tool_prefix}pdflatex; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_DX_PDFLATEX+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $DX_PDFLATEX in - [\\/]* | ?:[\\/]*) - ac_cv_path_DX_PDFLATEX="$DX_PDFLATEX" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_DX_PDFLATEX="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -DX_PDFLATEX=$ac_cv_path_DX_PDFLATEX -if test -n "$DX_PDFLATEX"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DX_PDFLATEX" >&5 -printf "%s\n" "$DX_PDFLATEX" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - -fi -if test -z "$ac_cv_path_DX_PDFLATEX"; then - ac_pt_DX_PDFLATEX=$DX_PDFLATEX - # Extract the first word of "pdflatex", so it can be a program name with args. -set dummy pdflatex; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_ac_pt_DX_PDFLATEX+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $ac_pt_DX_PDFLATEX in - [\\/]* | ?:[\\/]*) - ac_cv_path_ac_pt_DX_PDFLATEX="$ac_pt_DX_PDFLATEX" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_DX_PDFLATEX="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -ac_pt_DX_PDFLATEX=$ac_cv_path_ac_pt_DX_PDFLATEX -if test -n "$ac_pt_DX_PDFLATEX"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_PDFLATEX" >&5 -printf "%s\n" "$ac_pt_DX_PDFLATEX" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - if test "x$ac_pt_DX_PDFLATEX" = x; then - DX_PDFLATEX="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - DX_PDFLATEX=$ac_pt_DX_PDFLATEX - fi -else - DX_PDFLATEX="$ac_cv_path_DX_PDFLATEX" -fi - -if test "$DX_FLAG_pdf$DX_PDFLATEX" = 1; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: pdflatex not found - will not generate doxygen PDF documentation" >&5 -printf "%s\n" "$as_me: WARNING: pdflatex not found - will not generate doxygen PDF documentation" >&2;} - DX_FLAG_pdf=0 - -fi - - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}makeindex", so it can be a program name with args. -set dummy ${ac_tool_prefix}makeindex; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_DX_MAKEINDEX+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $DX_MAKEINDEX in - [\\/]* | ?:[\\/]*) - ac_cv_path_DX_MAKEINDEX="$DX_MAKEINDEX" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_DX_MAKEINDEX="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -DX_MAKEINDEX=$ac_cv_path_DX_MAKEINDEX -if test -n "$DX_MAKEINDEX"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DX_MAKEINDEX" >&5 -printf "%s\n" "$DX_MAKEINDEX" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - -fi -if test -z "$ac_cv_path_DX_MAKEINDEX"; then - ac_pt_DX_MAKEINDEX=$DX_MAKEINDEX - # Extract the first word of "makeindex", so it can be a program name with args. -set dummy makeindex; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_ac_pt_DX_MAKEINDEX+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $ac_pt_DX_MAKEINDEX in - [\\/]* | ?:[\\/]*) - ac_cv_path_ac_pt_DX_MAKEINDEX="$ac_pt_DX_MAKEINDEX" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_DX_MAKEINDEX="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -ac_pt_DX_MAKEINDEX=$ac_cv_path_ac_pt_DX_MAKEINDEX -if test -n "$ac_pt_DX_MAKEINDEX"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_MAKEINDEX" >&5 -printf "%s\n" "$ac_pt_DX_MAKEINDEX" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - if test "x$ac_pt_DX_MAKEINDEX" = x; then - DX_MAKEINDEX="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - DX_MAKEINDEX=$ac_pt_DX_MAKEINDEX - fi -else - DX_MAKEINDEX="$ac_cv_path_DX_MAKEINDEX" -fi - -if test "$DX_FLAG_pdf$DX_MAKEINDEX" = 1; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: makeindex not found - will not generate doxygen PDF documentation" >&5 -printf "%s\n" "$as_me: WARNING: makeindex not found - will not generate doxygen PDF documentation" >&2;} - DX_FLAG_pdf=0 - -fi - - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}egrep", so it can be a program name with args. -set dummy ${ac_tool_prefix}egrep; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_DX_EGREP+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $DX_EGREP in - [\\/]* | ?:[\\/]*) - ac_cv_path_DX_EGREP="$DX_EGREP" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_DX_EGREP="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -DX_EGREP=$ac_cv_path_DX_EGREP -if test -n "$DX_EGREP"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DX_EGREP" >&5 -printf "%s\n" "$DX_EGREP" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - -fi -if test -z "$ac_cv_path_DX_EGREP"; then - ac_pt_DX_EGREP=$DX_EGREP - # Extract the first word of "egrep", so it can be a program name with args. -set dummy egrep; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_ac_pt_DX_EGREP+y} -then : - printf %s "(cached) " >&6 + withval=$with_shared_mem; else $as_nop - case $ac_pt_DX_EGREP in - [\\/]* | ?:[\\/]*) - ac_cv_path_ac_pt_DX_EGREP="$ac_pt_DX_EGREP" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_DX_EGREP="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -ac_pt_DX_EGREP=$ac_cv_path_ac_pt_DX_EGREP -if test -n "$ac_pt_DX_EGREP"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_EGREP" >&5 -printf "%s\n" "$ac_pt_DX_EGREP" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - if test "x$ac_pt_DX_EGREP" = x; then - DX_EGREP="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - DX_EGREP=$ac_pt_DX_EGREP - fi -else - DX_EGREP="$ac_cv_path_DX_EGREP" + with_shared_mem=16384 fi -if test "$DX_FLAG_pdf$DX_EGREP" = 1; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: egrep not found - will not generate doxygen PDF documentation" >&5 -printf "%s\n" "$as_me: WARNING: egrep not found - will not generate doxygen PDF documentation" >&2;} - DX_FLAG_pdf=0 +GPU_SHAREDMEM=$with_shared_mem -fi +if test x$HAVE_CUDA = x0 +then : + GPU_SHAREDMEM=0 - : fi -if test "$DX_FLAG_pdf" = 1; then - : -else +# +# Bifrost memory alignment +# - : -fi +# Check whether --with-alignment was given. +if test ${with_alignment+y} +then : + withval=$with_alignment; +else $as_nop + with_alignment=4096 +fi -# LaTeX generation for PS and/or PDF: -if test "$DX_FLAG_ps" = 1 || test "$DX_FLAG_pdf" = 1; then - DX_ENV="$DX_ENV GENERATE_LATEX='YES'" -GENERATE_LATEX=YES +ALIGNMENT=$with_alignment -else - DX_ENV="$DX_ENV GENERATE_LATEX='NO'" -GENERATE_LATEX=NO -fi +# +# Bifrost proclog location +# -# Paper size for PS and/or PDF: -case "$DOXYGEN_PAPER_SIZE" in -#( -"") - DOXYGEN_PAPER_SIZE="" -;; #( -a4wide|a4|letter|legal|executive) - DX_ENV="$DX_ENV PAPER_SIZE='$DOXYGEN_PAPER_SIZE'" -PAPER_SIZE=$DOXYGEN_PAPER_SIZE -;; #( -*) - as_fn_error $? "unknown DOXYGEN_PAPER_SIZE='$DOXYGEN_PAPER_SIZE'" "$LINENO" 5 -;; -esac -# Rules: -if test $DX_FLAG_html -eq 1 +# Check whether --with-logging_dir was given. +if test ${with_logging_dir+y} then : - DX_SNIPPET_html="## ------------------------------- ## -## Rules specific for HTML output. ## -## ------------------------------- ## - -DX_CLEAN_HTML = \$(DX_DOCDIR)/html\\ - \$(DX_DOCDIR)/html + withval=$with_logging_dir; HAVE_TMPFS=$with_logging_dir -" else $as_nop - DX_SNIPPET_html="" + HAVE_TMPFS=/tmp + fi -if test $DX_FLAG_chi -eq 1 + + + if test "$HAVE_TMPFS" = "/tmp"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for /dev/shm" >&5 +printf %s "checking for /dev/shm... " >&6; } +if test ${ac_cv_file__dev_shm+y} then : - DX_SNIPPET_chi=" -DX_CLEAN_CHI = \$(DX_DOCDIR)/\$(PACKAGE).chi\\ - \$(DX_DOCDIR)/\$(PACKAGE).chi" + printf %s "(cached) " >&6 else $as_nop - DX_SNIPPET_chi="" + test "$cross_compiling" = yes && + as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 +if test -r "/dev/shm"; then + ac_cv_file__dev_shm=yes +else + ac_cv_file__dev_shm=no fi -if test $DX_FLAG_chm -eq 1 +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__dev_shm" >&5 +printf "%s\n" "$ac_cv_file__dev_shm" >&6; } +if test "x$ac_cv_file__dev_shm" = xyes then : - DX_SNIPPET_chm="## ------------------------------ ## -## Rules specific for CHM output. ## -## ------------------------------ ## + HAVE_TMPFS=/dev/shm/bifrost + +fi -DX_CLEAN_CHM = \$(DX_DOCDIR)/chm\\ - \$(DX_DOCDIR)/chm\ -${DX_SNIPPET_chi} + fi -" + if test "$HAVE_TMPFS" = "/tmp"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for /Volumes/RAMDisk" >&5 +printf %s "checking for /Volumes/RAMDisk... " >&6; } +if test ${ac_cv_file__Volumes_RAMDisk+y} +then : + printf %s "(cached) " >&6 else $as_nop - DX_SNIPPET_chm="" + test "$cross_compiling" = yes && + as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 +if test -r "/Volumes/RAMDisk"; then + ac_cv_file__Volumes_RAMDisk=yes +else + ac_cv_file__Volumes_RAMDisk=no +fi fi -if test $DX_FLAG_man -eq 1 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__Volumes_RAMDisk" >&5 +printf "%s\n" "$ac_cv_file__Volumes_RAMDisk" >&6; } +if test "x$ac_cv_file__Volumes_RAMDisk" = xyes then : - DX_SNIPPET_man="## ------------------------------ ## -## Rules specific for MAN output. ## -## ------------------------------ ## + HAVE_TMPFS=/Volumes/RAMDisk/bifrost -DX_CLEAN_MAN = \$(DX_DOCDIR)/man\\ - \$(DX_DOCDIR)/man +fi -" + fi + + if test "$HAVE_TMPFS" = "/tmp"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for /tmp" >&5 +printf %s "checking for /tmp... " >&6; } +if test ${ac_cv_file__tmp+y} +then : + printf %s "(cached) " >&6 else $as_nop - DX_SNIPPET_man="" + test "$cross_compiling" = yes && + as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 +if test -r "/tmp"; then + ac_cv_file__tmp=yes +else + ac_cv_file__tmp=no fi -if test $DX_FLAG_rtf -eq 1 +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__tmp" >&5 +printf "%s\n" "$ac_cv_file__tmp" >&6; } +if test "x$ac_cv_file__tmp" = xyes then : - DX_SNIPPET_rtf="## ------------------------------ ## -## Rules specific for RTF output. ## -## ------------------------------ ## + HAVE_TMPFS=/tmp -DX_CLEAN_RTF = \$(DX_DOCDIR)/rtf\\ - \$(DX_DOCDIR)/rtf +fi -" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $HAVE_TMPFS may have performance problems for logging" >&5 +printf "%s\n" "$as_me: WARNING: $HAVE_TMPFS may have performance problems for logging" >&2;} + HAVE_TMPFS=/tmp/bifrost + + fi + + +# +# Bifrost Features +# + +# Check whether --enable-debug was given. +if test ${enable_debug+y} +then : + enableval=$enable_debug; enable_debug=yes else $as_nop - DX_SNIPPET_rtf="" + enable_debug=no fi -if test $DX_FLAG_xml -eq 1 + +HAVE_DEBUG=0 + +if test x$enable_debug != xno then : - DX_SNIPPET_xml="## ------------------------------ ## -## Rules specific for XML output. ## -## ------------------------------ ## + HAVE_DEBUG=1 -DX_CLEAN_XML = \$(DX_DOCDIR)/xml\\ - \$(DX_DOCDIR)/xml + CXXFLAGS="$CXXFLAGS -g" + NVCCFLAGS="$NVCCFLAGS -g" +fi -" +# Check whether --enable-trace was given. +if test ${enable_trace+y} +then : + enableval=$enable_trace; enable_trace=yes else $as_nop - DX_SNIPPET_xml="" + enable_trace=no fi -if test $DX_FLAG_ps -eq 1 -then : - DX_SNIPPET_ps="## ----------------------------- ## -## Rules specific for PS output. ## -## ----------------------------- ## -DX_CLEAN_PS = \$(DX_DOCDIR)/\$(PACKAGE).ps\\ - \$(DX_DOCDIR)/\$(PACKAGE).ps +HAVE_TRACE=0 -DX_PS_GOAL = doxygen-ps +if test x$enable_trace != xno +then : + HAVE_TRACE=1 -doxygen-ps: \$(DX_CLEAN_PS) +fi -\$(DX_DOCDIR)/\$(PACKAGE).ps: \$(DX_DOCDIR)/\$(PACKAGE).tag - \$(DX_V_LATEX)cd \$(DX_DOCDIR)/latex; \\ - rm -f *.aux *.toc *.idx *.ind *.ilg *.log *.out; \\ - \$(DX_LATEX) refman.tex; \\ - \$(DX_MAKEINDEX) refman.idx; \\ - \$(DX_LATEX) refman.tex; \\ - countdown=5; \\ - while \$(DX_EGREP) 'Rerun (LaTeX|to get cross-references right)' \\ - refman.log > /dev/null 2>&1 \\ - && test \$\$countdown -gt 0; do \\ - \$(DX_LATEX) refman.tex; \\ - countdown=\`expr \$\$countdown - 1\`; \\ - done; \\ - \$(DX_DVIPS) -o ../\$(PACKAGE).ps refman.dvi -" + + # Check whether --enable-native_arch was given. +if test ${enable_native_arch+y} +then : + enableval=$enable_native_arch; enable_native_arch=no else $as_nop - DX_SNIPPET_ps="" + enable_native_arch=yes fi -if test $DX_FLAG_pdf -eq 1 -then : - DX_SNIPPET_pdf="## ------------------------------ ## -## Rules specific for PDF output. ## -## ------------------------------ ## -DX_CLEAN_PDF = \$(DX_DOCDIR)/\$(PACKAGE).pdf\\ - \$(DX_DOCDIR)/\$(PACKAGE).pdf -DX_PDF_GOAL = doxygen-pdf + if test "$enable_native_arch" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the compiler accepts '-march=native'" >&5 +printf %s "checking if the compiler accepts '-march=native'... " >&6; } + + CXXFLAGS_temp="$CXXFLAGS -march=native" -doxygen-pdf: \$(DX_CLEAN_PDF) + ac_compile='$CXX -c $CXXFLAGS_temp conftest.$ac_ext >&5' + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -\$(DX_DOCDIR)/\$(PACKAGE).pdf: \$(DX_DOCDIR)/\$(PACKAGE).tag - \$(DX_V_LATEX)cd \$(DX_DOCDIR)/latex; \\ - rm -f *.aux *.toc *.idx *.ind *.ilg *.log *.out; \\ - \$(DX_PDFLATEX) refman.tex; \\ - \$(DX_MAKEINDEX) refman.idx; \\ - \$(DX_PDFLATEX) refman.tex; \\ - countdown=5; \\ - while \$(DX_EGREP) 'Rerun (LaTeX|to get cross-references right)' \\ - refman.log > /dev/null 2>&1 \\ - && test \$\$countdown -gt 0; do \\ - \$(DX_PDFLATEX) refman.tex; \\ - countdown=\`expr \$\$countdown - 1\`; \\ - done; \\ - mv refman.pdf ../\$(PACKAGE).pdf -" + +int +main (void) +{ + + int i = 5; + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + CXXFLAGS="$CXXFLAGS -march=native" + NVCCFLAGS="$NVCCFLAGS -Xcompiler \"-march=native\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else $as_nop + enable_native_arch=no + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + fi + + +# Check whether --enable-cuda_debug was given. +if test ${enable_cuda_debug+y} +then : + enableval=$enable_cuda_debug; enable_cuda_debug=yes else $as_nop - DX_SNIPPET_pdf="" + enable_cuda_debug=no fi -if test $DX_FLAG_ps -eq 1 -o $DX_FLAG_pdf -eq 1 + +HAVE_CUDA_DEBUG=0 + +if test x$enable_cuda_debug != xno then : - DX_SNIPPET_latex="## ------------------------------------------------- ## -## Rules specific for LaTeX (shared for PS and PDF). ## -## ------------------------------------------------- ## + HAVE_CUDA_DEBUG=1 -DX_V_LATEX = \$(_DX_v_LATEX_\$(V)) -_DX_v_LATEX_ = \$(_DX_v_LATEX_\$(AM_DEFAULT_VERBOSITY)) -_DX_v_LATEX_0 = @echo \" LATEX \" \$@; + NVCCFLAGS="$NVCCFLAGS -G" +fi -DX_CLEAN_LATEX = \$(DX_DOCDIR)/latex\\ - \$(DX_DOCDIR)/latex -" + +# Check whether --with-mapped_ring_dir was given. +if test ${with_mapped_ring_dir+y} +then : + withval=$with_mapped_ring_dir; else $as_nop - DX_SNIPPET_latex="" + mapped_ring_dir=/tmp/bifrost_mapped fi -if test $DX_FLAG_doc -eq 1 +MAPPED_RING_DIR=$mapped_ring_dir + + +# +# Python +# + +# Check whether --enable-python was given. +if test ${enable_python+y} then : - DX_SNIPPET_doc="## --------------------------------- ## -## Format-independent Doxygen rules. ## -## --------------------------------- ## + enableval=$enable_python; enable_python=no +else $as_nop + enable_python=yes +fi + +HAVE_PYTHON=0 -${DX_SNIPPET_html}\ -${DX_SNIPPET_chm}\ -${DX_SNIPPET_man}\ -${DX_SNIPPET_rtf}\ -${DX_SNIPPET_xml}\ -${DX_SNIPPET_ps}\ -${DX_SNIPPET_pdf}\ -${DX_SNIPPET_latex}\ -DX_V_DXGEN = \$(_DX_v_DXGEN_\$(V)) -_DX_v_DXGEN_ = \$(_DX_v_DXGEN_\$(AM_DEFAULT_VERBOSITY)) -_DX_v_DXGEN_0 = @echo \" DXGEN \" \$<; +if test x$enable_python != xno +then : + AX_WITH_PROG(PYTHON, python, no, $PATH) + if test x${PYTHON} != xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $PYTHON as ctypesgen" >&5 +printf %s "checking whether $PYTHON as ctypesgen... " >&6; } + if ! ${PYTHON} -c "import ctypesgen" 2>/dev/null +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: python module will not be built" >&5 +printf "%s\n" "$as_me: WARNING: python module will not be built" >&2;} +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + HAVE_PYTHON=1 -.PHONY: doxygen-run doxygen-doc \$(DX_PS_GOAL) \$(DX_PDF_GOAL) +fi +fi +fi -.INTERMEDIATE: doxygen-run \$(DX_PS_GOAL) \$(DX_PDF_GOAL) +# Check whether --with-pybuild_flags was given. +if test ${with_pybuild_flags+y} +then : + withval=$with_pybuild_flags; +fi -doxygen-run: \$(DX_DOCDIR)/\$(PACKAGE).tag +PYBUILDFLAGS=$with_pybuild_flags -doxygen-doc: doxygen-run \$(DX_PS_GOAL) \$(DX_PDF_GOAL) -\$(DX_DOCDIR)/\$(PACKAGE).tag: \$(DX_CONFIG) \$(pkginclude_HEADERS) - \$(A""M_V_at)rm -rf \$(DX_DOCDIR) - \$(DX_V_DXGEN)\$(DX_ENV) DOCDIR=\$(DX_DOCDIR) \$(DX_DOXYGEN) \$(DX_CONFIG) - \$(A""M_V_at)echo Timestamp >\$@ -DX_CLEANFILES = \\ - \$(DX_DOCDIR)/doxygen_sqlite3.db \\ - \$(DX_DOCDIR)/\$(PACKAGE).tag \\ - -r \\ - \$(DX_CLEAN_HTML) \\ - \$(DX_CLEAN_CHM) \\ - \$(DX_CLEAN_CHI) \\ - \$(DX_CLEAN_MAN) \\ - \$(DX_CLEAN_RTF) \\ - \$(DX_CLEAN_XML) \\ - \$(DX_CLEAN_PS) \\ - \$(DX_CLEAN_PDF) \\ - \$(DX_CLEAN_LATEX)" -else $as_nop - DX_SNIPPET_doc="" +# Check whether --with-pyinstall_flags was given. +if test ${with_pyinstall_flags+y} +then : + withval=$with_pyinstall_flags; fi -DX_RULES="${DX_SNIPPET_doc}" +PYINSTALLFLAGS=$with_pyinstall_flags + + +# +# Docker +# + +AX_WITH_PROG(DOCKER, docker, no, $PATH) +if test x${DOCKER} != xno +then : + HAVE_DOCKER=1 + +fi -#For debugging: -#echo DX_FLAG_doc=$DX_FLAG_doc -#echo DX_FLAG_dot=$DX_FLAG_dot -#echo DX_FLAG_man=$DX_FLAG_man -#echo DX_FLAG_html=$DX_FLAG_html -#echo DX_FLAG_chm=$DX_FLAG_chm -#echo DX_FLAG_chi=$DX_FLAG_chi -#echo DX_FLAG_rtf=$DX_FLAG_rtf -#echo DX_FLAG_xml=$DX_FLAG_xml -#echo DX_FLAG_pdf=$DX_FLAG_pdf -#echo DX_FLAG_ps=$DX_FLAG_ps -#echo DX_ENV=$DX_ENV +# +# Documentation +# +DX_DOT_FEATURE(OFF) +DX_HTML_FEATURE(ON) +DX_CHM_FEATURE(OFF) +DX_CHI_FEATURE(OFF) +DX_MAN_FEATURE(ON) +DX_RTF_FEATURE(OFF) +DX_XML_FEATURE(OFF) +DX_PDF_FEATURE(ON) +DX_PS_FEATURE(ON) +DX_INIT_DOXYGEN(bifrost) # # Version splitting diff --git a/configure.ac b/configure.ac index 004a359c5..c7a2f00d2 100644 --- a/configure.ac +++ b/configure.ac @@ -209,9 +209,9 @@ AS_IF([test x$enable_cuda_debug != xno], AC_ARG_WITH([mapped_ring_dir], [AS_HELP_STRING([--with-mapped-ring-dir=...], - [directory to store mapped ring files in (default=/tmp/bifrost)])], + [directory to store mapped ring files in (default=/tmp/bifrost_mapped)])], [], - [mapped_ring_dir=/tmp/bifrost]) + [mapped_ring_dir=/tmp/bifrost_mapped]) AC_SUBST([MAPPED_RING_DIR], [$mapped_ring_dir]) # From 58c72813ca3e801f29f5dde9351bca098fbcce5d Mon Sep 17 00:00:00 2001 From: jaycedowell Date: Wed, 23 Mar 2022 10:50:24 -0600 Subject: [PATCH 37/48] Rebuild configure (this gets old). --- configure | 5838 ++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 4679 insertions(+), 1159 deletions(-) diff --git a/configure b/configure index f0a3b1ad6..f41e9d89e 100755 --- a/configure +++ b/configure @@ -661,9 +661,50 @@ LTLIBOBJS PACKAGE_VERSION_MICRO PACKAGE_VERSION_MINOR PACKAGE_VERSION_MAJOR +DX_RULES +PAPER_SIZE +DOXYGEN_PAPER_SIZE +GENERATE_LATEX +DX_PDFLATEX +DX_FLAG_pdf +DX_EGREP +DX_DVIPS +DX_MAKEINDEX +DX_LATEX +DX_FLAG_ps +DX_FLAG_html +GENERATE_CHI +DX_FLAG_chi +GENERATE_HTMLHELP +GENERATE_HTML +HHC_PATH +DX_HHC +DX_FLAG_chm +GENERATE_XML +DX_FLAG_xml +GENERATE_RTF +DX_FLAG_rtf +GENERATE_MAN +DX_FLAG_man +DOT_PATH +HAVE_DOT +DX_DOT +DX_FLAG_dot +PERL_PATH +DX_PERL +DX_DOXYGEN +DX_FLAG_doc +PROJECT +SRCDIR +DX_ENV +DX_DOCDIR +DX_CONFIG +DX_PROJECT HAVE_DOCKER +DOCKER PYINSTALLFLAGS PYBUILDFLAGS +PYTHON HAVE_PYTHON MAPPED_RING_DIR HAVE_CUDA_DEBUG @@ -690,7 +731,10 @@ HAVE_FLOAT128 HAVE_OPENMP LIBOBJS HAVE_RECVMSG +HAVE_CXX11 +HAVE_CXX14 SO_EXT +CTAGS SET_MAKE INSTALL_DATA INSTALL_SCRIPT @@ -789,6 +833,7 @@ with_aix_soname with_gnu_ld with_sysroot enable_libtool_lock +with_ctags enable_numa enable_hwloc enable_vma @@ -805,8 +850,20 @@ enable_native_arch enable_cuda_debug with_mapped_ring_dir enable_python +with_python with_pybuild_flags with_pyinstall_flags +with_docker +enable_doxygen_doc +enable_doxygen_dot +enable_doxygen_man +enable_doxygen_rtf +enable_doxygen_xml +enable_doxygen_chm +enable_doxygen_chi +enable_doxygen_html +enable_doxygen_ps +enable_doxygen_pdf ' ac_precious_vars='build_alias host_alias @@ -820,7 +877,11 @@ CXX CXXFLAGS CCC LT_SYS_LIBRARY_PATH -CXXCPP' +CXXCPP +CTAGS +PYTHON +DOCKER +DOXYGEN_PAPER_SIZE' # Initialize some variables set by options. @@ -1457,6 +1518,17 @@ Optional Features: --disable-native-arch disable native architecture compilation (default=no) --enable-cuda-debug enable CUDA debugging (nvcc -G; default=no) --disable-python disable building the Python bindings (default=no) + --disable-doxygen-doc don't generate any doxygen documentation + --enable-doxygen-dot generate graphics for doxygen documentation + --disable-doxygen-man don't generate doxygen manual pages + --enable-doxygen-rtf generate doxygen RTF documentation + --enable-doxygen-xml generate doxygen XML documentation + --enable-doxygen-chm generate doxygen compressed HTML help documentation + --enable-doxygen-chi generate doxygen separate compressed HTML help index + file + --disable-doxygen-html don't generate doxygen plain HTML documentation + --disable-doxygen-ps don't generate doxygen PostScript documentation + --disable-doxygen-pdf don't generate doxygen PDF documentation Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -1469,6 +1541,7 @@ Optional Packages: --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified). + --with-ctags=[PATH] absolute path to ctags executable --with-cuda-home CUDA install path (default=/usr/local/cuda) --with-nvcc-flags flags to pass to NVCC (default='-O3 -Xcompiler "-Wall"') @@ -1480,8 +1553,10 @@ Optional Packages: --with-mapped-ring-dir=... directory to store mapped ring files in (default=/tmp/bifrost_mapped) + --with-python=[PATH] absolute path to python executable --with-pybuild-flags build flags for python (default='') --with-pyinstall-flags install flags for python (default='') + --with-docker=[PATH] absolute path to docker executable Some influential environment variables: CC C compiler command @@ -1496,6 +1571,11 @@ Some influential environment variables: LT_SYS_LIBRARY_PATH User-defined run-time library search path. CXXCPP C++ preprocessor + CTAGS Absolute path to ctags executable + PYTHON Absolute path to python executable + DOCKER Absolute path to docker executable + DOXYGEN_PAPER_SIZE + a4wide (default), a4, letter, legal or executive Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. @@ -17368,7 +17448,151 @@ printf "%s\n" "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi -AX_WITH_PROG(CTAGS, ctags) + + + + + + + + + + + if test -z "$CTAGS" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ctags executable path has been provided" >&5 +printf %s "checking whether ctags executable path has been provided... " >&6; } + +# Check whether --with-ctags was given. +if test ${with_ctags+y} +then : + withval=$with_ctags; + if test "$withval" != yes && test "$withval" != no +then : + + CTAGS="$withval" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CTAGS" >&5 +printf "%s\n" "$CTAGS" >&6; } + +else $as_nop + + CTAGS="" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + if test "$withval" != no +then : + + # Extract the first word of "ctags", so it can be a program name with args. +set dummy ctags; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_CTAGS+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $CTAGS in + [\\/]* | ?:[\\/]*) + ac_cv_path_CTAGS="$CTAGS" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_CTAGS="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +CTAGS=$ac_cv_path_CTAGS +if test -n "$CTAGS"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CTAGS" >&5 +printf "%s\n" "$CTAGS" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + +fi + +fi + +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + # Extract the first word of "ctags", so it can be a program name with args. +set dummy ctags; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_CTAGS+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $CTAGS in + [\\/]* | ?:[\\/]*) + ac_cv_path_CTAGS="$CTAGS" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_CTAGS="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +CTAGS=$ac_cv_path_CTAGS +if test -n "$CTAGS"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CTAGS" >&5 +printf "%s\n" "$CTAGS" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + +fi + + +fi + + + + + + if test x${CTAGS} = x then : as_fn_error $? "Required program ctags was not found" "$LINENO" 5 @@ -17436,1466 +17660,4762 @@ _ACEOF ;; esac -AX_CXX_COMPILE_STDCXX(14, noext, optional) -if test x$HAVE_CXX14 != x1 -then : - AX_CXX_COMPILE_STDCXX(11, noext, mandatory) -fi -ac_fn_cxx_check_func "$LINENO" "memset" "ac_cv_func_memset" -if test "x$ac_cv_func_memset" = xyes -then : - printf "%s\n" "#define HAVE_MEMSET 1" >>confdefs.h + ax_cxx_compile_alternatives="14 1y" ax_cxx_compile_cxx14_required=false + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + ac_success=no -fi -ac_fn_cxx_check_func "$LINENO" "rint" "ac_cv_func_rint" -if test "x$ac_cv_func_rint" = xyes -then : - printf "%s\n" "#define HAVE_RINT 1" >>confdefs.h -fi -ac_fn_cxx_check_func "$LINENO" "socket" "ac_cv_func_socket" -if test "x$ac_cv_func_socket" = xyes + + if test x$ac_success = xno; then + for alternative in ${ax_cxx_compile_alternatives}; do + for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}"; do + cachevar=`printf "%s\n" "ax_cv_cxx_compile_cxx14_$switch" | $as_tr_sh` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++14 features with $switch" >&5 +printf %s "checking whether $CXX supports C++14 features with $switch... " >&6; } +if eval test \${$cachevar+y} then : - printf "%s\n" "#define HAVE_SOCKET 1" >>confdefs.h + printf %s "(cached) " >&6 +else $as_nop + ac_save_CXX="$CXX" + CXX="$CXX $switch" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -fi +// If the compiler admits that it is not ready for C++11, why torture it? +// Hopefully, this will speed up the test. - for ac_func in recvmsg -do : - ac_fn_cxx_check_func "$LINENO" "recvmsg" "ac_cv_func_recvmsg" -if test "x$ac_cv_func_recvmsg" = xyes -then : - printf "%s\n" "#define HAVE_RECVMSG 1" >>confdefs.h - HAVE_RECVMSG=1 +#ifndef __cplusplus -else $as_nop - HAVE_RECVMSG=0 +#error "This is not a C++ compiler" -fi +#elif __cplusplus < 201103L -done -ac_fn_cxx_check_func "$LINENO" "sqrt" "ac_cv_func_sqrt" -if test "x$ac_cv_func_sqrt" = xyes -then : - printf "%s\n" "#define HAVE_SQRT 1" >>confdefs.h +#error "This is not a C++11 compiler" -fi +#else -ac_fn_cxx_check_func "$LINENO" "strerror" "ac_cv_func_strerror" -if test "x$ac_cv_func_strerror" = xyes -then : - printf "%s\n" "#define HAVE_STRERROR 1" >>confdefs.h +namespace cxx11 +{ -fi + namespace test_static_assert + { -ac_fn_cxx_check_header_compile "$LINENO" "arpa/inet.h" "ac_cv_header_arpa_inet_h" "$ac_includes_default" -if test "x$ac_cv_header_arpa_inet_h" = xyes -then : - printf "%s\n" "#define HAVE_ARPA_INET_H 1" >>confdefs.h + template + struct check + { + static_assert(sizeof(int) <= sizeof(T), "not big enough"); + }; -fi + } -ac_fn_cxx_check_header_compile "$LINENO" "netdb.h" "ac_cv_header_netdb_h" "$ac_includes_default" -if test "x$ac_cv_header_netdb_h" = xyes -then : - printf "%s\n" "#define HAVE_NETDB_H 1" >>confdefs.h + namespace test_final_override + { -fi + struct Base + { + virtual ~Base() {} + virtual void f() {} + }; -ac_fn_cxx_check_header_compile "$LINENO" "netinet/in.h" "ac_cv_header_netinet_in_h" "$ac_includes_default" -if test "x$ac_cv_header_netinet_in_h" = xyes -then : - printf "%s\n" "#define HAVE_NETINET_IN_H 1" >>confdefs.h + struct Derived : public Base + { + virtual ~Derived() override {} + virtual void f() override {} + }; -fi + } -ac_fn_cxx_check_header_compile "$LINENO" "sys/file.h" "ac_cv_header_sys_file_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_file_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_FILE_H 1" >>confdefs.h + namespace test_double_right_angle_brackets + { -fi + template < typename T > + struct check {}; -ac_fn_cxx_check_header_compile "$LINENO" "sys/ioctl.h" "ac_cv_header_sys_ioctl_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_ioctl_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_IOCTL_H 1" >>confdefs.h + typedef check single_type; + typedef check> double_type; + typedef check>> triple_type; + typedef check>>> quadruple_type; -fi + } -ac_fn_cxx_check_header_compile "$LINENO" "sys/socket.h" "ac_cv_header_sys_socket_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_socket_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_SOCKET_H 1" >>confdefs.h + namespace test_decltype + { -fi + int + f() + { + int a = 1; + decltype(a) b = 2; + return a + b; + } -ac_fn_cxx_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default" -if test "x$ac_cv_type__Bool" = xyes -then : + } -printf "%s\n" "#define HAVE__BOOL 1" >>confdefs.h + namespace test_type_deduction + { + template < typename T1, typename T2 > + struct is_same + { + static const bool value = false; + }; -fi + template < typename T > + struct is_same + { + static const bool value = true; + }; - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5 -printf %s "checking for stdbool.h that conforms to C99... " >&6; } -if test ${ac_cv_header_stdbool_h+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include + template < typename T1, typename T2 > + auto + add(T1 a1, T2 a2) -> decltype(a1 + a2) + { + return a1 + a2; + } - #ifndef __bool_true_false_are_defined - #error "__bool_true_false_are_defined is not defined" - #endif - char a[__bool_true_false_are_defined == 1 ? 1 : -1]; + int + test(const int c, volatile int v) + { + static_assert(is_same::value == true, ""); + static_assert(is_same::value == false, ""); + static_assert(is_same::value == false, ""); + auto ac = c; + auto av = v; + auto sumi = ac + av + 'x'; + auto sumf = ac + av + 1.0; + static_assert(is_same::value == true, ""); + static_assert(is_same::value == true, ""); + static_assert(is_same::value == true, ""); + static_assert(is_same::value == false, ""); + static_assert(is_same::value == true, ""); + return (sumf > 0.0) ? sumi : add(c, v); + } - /* Regardless of whether this is C++ or "_Bool" is a - valid type name, "true" and "false" should be usable - in #if expressions and integer constant expressions, - and "bool" should be a valid type name. */ + } - #if !true - #error "'true' is not true" - #endif - #if true != 1 - #error "'true' is not equal to 1" - #endif - char b[true == 1 ? 1 : -1]; - char c[true]; + namespace test_noexcept + { - #if false - #error "'false' is not false" - #endif - #if false != 0 - #error "'false' is not equal to 0" - #endif - char d[false == 0 ? 1 : -1]; + int f() { return 0; } + int g() noexcept { return 0; } - enum { e = false, f = true, g = false * true, h = true * 256 }; + static_assert(noexcept(f()) == false, ""); + static_assert(noexcept(g()) == true, ""); - char i[(bool) 0.5 == true ? 1 : -1]; - char j[(bool) 0.0 == false ? 1 : -1]; - char k[sizeof (bool) > 0 ? 1 : -1]; + } - struct sb { bool s: 1; bool t; } s; - char l[sizeof s.t > 0 ? 1 : -1]; + namespace test_constexpr + { - /* The following fails for - HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ - bool m[h]; - char n[sizeof m == h * sizeof m[0] ? 1 : -1]; - char o[-1 - (bool) 0 < 0 ? 1 : -1]; - /* Catch a bug in an HP-UX C compiler. See - https://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html - https://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html - */ - bool p = true; - bool *pp = &p; + template < typename CharT > + unsigned long constexpr + strlen_c_r(const CharT *const s, const unsigned long acc) noexcept + { + return *s ? strlen_c_r(s + 1, acc + 1) : acc; + } - /* C 1999 specifies that bool, true, and false are to be - macros, but C++ 2011 and later overrule this. */ - #if __cplusplus < 201103 - #ifndef bool - #error "bool is not defined" - #endif - #ifndef false - #error "false is not defined" - #endif - #ifndef true - #error "true is not defined" - #endif - #endif + template < typename CharT > + unsigned long constexpr + strlen_c(const CharT *const s) noexcept + { + return strlen_c_r(s, 0UL); + } - /* If _Bool is available, repeat with it all the tests - above that used bool. */ - #ifdef HAVE__BOOL - struct sB { _Bool s: 1; _Bool t; } t; + static_assert(strlen_c("") == 0UL, ""); + static_assert(strlen_c("1") == 1UL, ""); + static_assert(strlen_c("example") == 7UL, ""); + static_assert(strlen_c("another\0example") == 7UL, ""); - char q[(_Bool) 0.5 == true ? 1 : -1]; - char r[(_Bool) 0.0 == false ? 1 : -1]; - char u[sizeof (_Bool) > 0 ? 1 : -1]; - char v[sizeof t.t > 0 ? 1 : -1]; + } - _Bool w[h]; - char x[sizeof m == h * sizeof m[0] ? 1 : -1]; - char y[-1 - (_Bool) 0 < 0 ? 1 : -1]; - _Bool z = true; - _Bool *pz = &p; - #endif + namespace test_rvalue_references + { -int -main (void) -{ + template < int N > + struct answer + { + static constexpr int value = N; + }; - bool ps = &s; - *pp |= p; - *pp |= ! p; + answer<1> f(int&) { return answer<1>(); } + answer<2> f(const int&) { return answer<2>(); } + answer<3> f(int&&) { return answer<3>(); } - #ifdef HAVE__BOOL - _Bool pt = &t; - *pz |= z; - *pz |= ! z; - #endif + void + test() + { + int i = 0; + const int c = 0; + static_assert(decltype(f(i))::value == 1, ""); + static_assert(decltype(f(c))::value == 2, ""); + static_assert(decltype(f(0))::value == 3, ""); + } - /* Refer to every declared value, so they cannot be - discarded as unused. */ - return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !j + !k - + !l + !m + !n + !o + !p + !pp + !ps - #ifdef HAVE__BOOL - + !q + !r + !u + !v + !w + !x + !y + !z + !pt - #endif - ); + } - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : - ac_cv_header_stdbool_h=yes -else $as_nop - ac_cv_header_stdbool_h=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5 -printf "%s\n" "$ac_cv_header_stdbool_h" >&6; } + namespace test_uniform_initialization + { -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5 -printf %s "checking for GNU libc compatible malloc... " >&6; } -if test ${ac_cv_func_malloc_0_nonnull+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test "$cross_compiling" = yes -then : - case "$host_os" in # (( - # Guess yes on platforms where we know the result. - *-gnu* | freebsd* | netbsd* | openbsd* | bitrig* \ - | hpux* | solaris* | cygwin* | mingw* | msys* ) - ac_cv_func_malloc_0_nonnull=yes ;; - # If we don't know, assume the worst. - *) ac_cv_func_malloc_0_nonnull=no ;; - esac -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include + struct test + { + static const int zero {}; + static const int one {1}; + }; -int -main (void) -{ -void *p = malloc (0); - int result = !p; - free (p); - return result; - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_run "$LINENO" -then : - ac_cv_func_malloc_0_nonnull=yes -else $as_nop - ac_cv_func_malloc_0_nonnull=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi + static_assert(test::zero == 0, ""); + static_assert(test::one == 1, ""); -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5 -printf "%s\n" "$ac_cv_func_malloc_0_nonnull" >&6; } -if test $ac_cv_func_malloc_0_nonnull = yes -then : + } -printf "%s\n" "#define HAVE_MALLOC 1" >>confdefs.h + namespace test_lambdas + { -else $as_nop - printf "%s\n" "#define HAVE_MALLOC 0" >>confdefs.h + void + test1() + { + auto lambda1 = [](){}; + auto lambda2 = lambda1; + lambda1(); + lambda2(); + } - case " $LIBOBJS " in - *" malloc.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS malloc.$ac_objext" - ;; -esac + int + test2() + { + auto a = [](int i, int j){ return i + j; }(1, 2); + auto b = []() -> int { return '0'; }(); + auto c = [=](){ return a + b; }(); + auto d = [&](){ return c; }(); + auto e = [a, &b](int x) mutable { + const auto identity = [](int y){ return y; }; + for (auto i = 0; i < a; ++i) + a += b--; + return x + identity(a + b); + }(0); + return a + b + c + d + e; + } + int + test3() + { + const auto nullary = [](){ return 0; }; + const auto unary = [](int x){ return x; }; + using nullary_t = decltype(nullary); + using unary_t = decltype(unary); + const auto higher1st = [](nullary_t f){ return f(); }; + const auto higher2nd = [unary](nullary_t f1){ + return [unary, f1](unary_t f2){ return f2(unary(f1())); }; + }; + return higher1st(nullary) + higher2nd(nullary)(unary); + } -printf "%s\n" "#define malloc rpl_malloc" >>confdefs.h + } -fi + namespace test_variadic_templates + { + template + struct sum; + template + struct sum + { + static constexpr auto value = N0 + sum::value; + }; -HAVE_OPENMP=0 + template <> + struct sum<> + { + static constexpr auto value = 0; + }; -AX_OPENMP -if test x$OPENMP_CXXFLAGS != x -then : - HAVE_OPENMP=1 + static_assert(sum<>::value == 0, ""); + static_assert(sum<1>::value == 1, ""); + static_assert(sum<23>::value == 23, ""); + static_assert(sum<1, 2>::value == 3, ""); + static_assert(sum<5, 5, 11>::value == 21, ""); + static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); -fi -if test x$HAVE_OPENMP != x1 -then : + } -else $as_nop - CXXFLAGS="$CXXFLAGS $OPENMP_CXXFLAGS" - LDFLAGS="$LDFLAGS $OPENMP_CXXFLAGS" -fi + // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae + // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function + // because of this. + namespace test_template_alias_sfinae + { -ac_fn_cxx_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default" -if test "x$ac_cv_type_ptrdiff_t" = xyes -then : + struct foo {}; -printf "%s\n" "#define HAVE_PTRDIFF_T 1" >>confdefs.h + template + using member = typename T::member_type; + template + void func(...) {} -fi + template + void func(member*) {} -ac_fn_c_find_intX_t "$LINENO" "16" "ac_cv_c_int16_t" -case $ac_cv_c_int16_t in #( - no|yes) ;; #( - *) + void test(); -printf "%s\n" "#define int16_t $ac_cv_c_int16_t" >>confdefs.h -;; -esac + void test() { func(0); } -ac_fn_c_find_intX_t "$LINENO" "32" "ac_cv_c_int32_t" -case $ac_cv_c_int32_t in #( - no|yes) ;; #( - *) + } -printf "%s\n" "#define int32_t $ac_cv_c_int32_t" >>confdefs.h -;; -esac +} // namespace cxx11 -ac_fn_c_find_intX_t "$LINENO" "64" "ac_cv_c_int64_t" -case $ac_cv_c_int64_t in #( - no|yes) ;; #( - *) +#endif // __cplusplus >= 201103L -printf "%s\n" "#define int64_t $ac_cv_c_int64_t" >>confdefs.h -;; -esac -ac_fn_c_find_intX_t "$LINENO" "8" "ac_cv_c_int8_t" -case $ac_cv_c_int8_t in #( - no|yes) ;; #( - *) -printf "%s\n" "#define int8_t $ac_cv_c_int8_t" >>confdefs.h -;; -esac +// If the compiler admits that it is not ready for C++14, why torture it? +// Hopefully, this will speed up the test. - ac_fn_cxx_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default -" -if test "x$ac_cv_type_pid_t" = xyes -then : +#ifndef __cplusplus -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +#error "This is not a C++ compiler" - #if defined _WIN64 && !defined __CYGWIN__ - LLP64 - #endif +#elif __cplusplus < 201402L -int -main (void) +#error "This is not a C++14 compiler" + +#else + +namespace cxx14 { - ; - return 0; -} + namespace test_polymorphic_lambdas + { -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : - ac_pid_type='int' -else $as_nop - ac_pid_type='__int64' -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + int + test() + { + const auto lambda = [](auto&&... args){ + const auto istiny = [](auto x){ + return (sizeof(x) == 1UL) ? 1 : 0; + }; + const int aretiny[] = { istiny(args)... }; + return aretiny[0]; + }; + return lambda(1, 1L, 1.0f, '1'); + } -printf "%s\n" "#define pid_t $ac_pid_type" >>confdefs.h + } + namespace test_binary_literals + { -fi + constexpr auto ivii = 0b0000000000101010; + static_assert(ivii == 42, "wrong value"); + } -ac_fn_cxx_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" -if test "x$ac_cv_type_size_t" = xyes -then : + namespace test_generalized_constexpr + { -else $as_nop + template < typename CharT > + constexpr unsigned long + strlen_c(const CharT *const s) noexcept + { + auto length = 0UL; + for (auto p = s; *p; ++p) + ++length; + return length; + } -printf "%s\n" "#define size_t unsigned int" >>confdefs.h + static_assert(strlen_c("") == 0UL, ""); + static_assert(strlen_c("x") == 1UL, ""); + static_assert(strlen_c("test") == 4UL, ""); + static_assert(strlen_c("another\0test") == 7UL, ""); -fi + } -ac_fn_cxx_check_type "$LINENO" "ssize_t" "ac_cv_type_ssize_t" "$ac_includes_default" -if test "x$ac_cv_type_ssize_t" = xyes -then : + namespace test_lambda_init_capture + { -else $as_nop + int + test() + { + auto x = 0; + const auto lambda1 = [a = x](int b){ return a + b; }; + const auto lambda2 = [a = lambda1(x)](){ return a; }; + return lambda2(); + } -printf "%s\n" "#define ssize_t int" >>confdefs.h + } -fi + namespace test_digit_separators + { -ac_fn_c_find_uintX_t "$LINENO" "16" "ac_cv_c_uint16_t" -case $ac_cv_c_uint16_t in #( - no|yes) ;; #( - *) - - -printf "%s\n" "#define uint16_t $ac_cv_c_uint16_t" >>confdefs.h -;; - esac - -ac_fn_c_find_uintX_t "$LINENO" "32" "ac_cv_c_uint32_t" -case $ac_cv_c_uint32_t in #( - no|yes) ;; #( - *) - -printf "%s\n" "#define _UINT32_T 1" >>confdefs.h + constexpr auto ten_million = 100'000'000; + static_assert(ten_million == 100000000, ""); + } -printf "%s\n" "#define uint32_t $ac_cv_c_uint32_t" >>confdefs.h -;; - esac - -ac_fn_c_find_uintX_t "$LINENO" "64" "ac_cv_c_uint64_t" -case $ac_cv_c_uint64_t in #( - no|yes) ;; #( - *) - -printf "%s\n" "#define _UINT64_T 1" >>confdefs.h + namespace test_return_type_deduction + { + auto f(int& x) { return x; } + decltype(auto) g(int& x) { return x; } -printf "%s\n" "#define uint64_t $ac_cv_c_uint64_t" >>confdefs.h -;; - esac + template < typename T1, typename T2 > + struct is_same + { + static constexpr auto value = false; + }; -ac_fn_c_find_uintX_t "$LINENO" "8" "ac_cv_c_uint8_t" -case $ac_cv_c_uint8_t in #( - no|yes) ;; #( - *) + template < typename T > + struct is_same + { + static constexpr auto value = true; + }; -printf "%s\n" "#define _UINT8_T 1" >>confdefs.h + int + test() + { + auto x = 0; + static_assert(is_same::value, ""); + static_assert(is_same::value, ""); + return x; + } + } -printf "%s\n" "#define uint8_t $ac_cv_c_uint8_t" >>confdefs.h -;; - esac +} // namespace cxx14 +#endif // __cplusplus >= 201402L - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for long double with more range or precision than double" >&5 -printf %s "checking for long double with more range or precision than double... " >&6; } -if test ${ac_cv_type_long_double_wider+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - long double const a[] = - { - 0.0L, DBL_MIN, DBL_MAX, DBL_EPSILON, - LDBL_MIN, LDBL_MAX, LDBL_EPSILON - }; - long double - f (long double x) - { - return ((x + (unsigned long int) 10) * (-1 / x) + a[0] - + (x ? f (x) : 'c')); - } -int -main (void) -{ -static int test_array [1 - 2 * !((0 < ((DBL_MAX_EXP < LDBL_MAX_EXP) - + (DBL_MANT_DIG < LDBL_MANT_DIG) - - (LDBL_MAX_EXP < DBL_MAX_EXP) - - (LDBL_MANT_DIG < DBL_MANT_DIG))) - && (int) LDBL_EPSILON == 0 - )]; -test_array [0] = 0; -return test_array [0]; - ; - return 0; -} _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : - ac_cv_type_long_double_wider=yes + eval $cachevar=yes else $as_nop - ac_cv_type_long_double_wider=no + eval $cachevar=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + CXX="$ac_save_CXX" fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_double_wider" >&5 -printf "%s\n" "$ac_cv_type_long_double_wider" >&6; } - if test $ac_cv_type_long_double_wider = yes; then +eval ac_res=\$$cachevar + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test x\$$cachevar = xyes; then + CXX="$CXX $switch" + if test -n "$CXXCPP" ; then + CXXCPP="$CXXCPP $switch" + fi + ac_success=yes + break + fi + done + if test x$ac_success = xyes; then + break + fi + done + fi + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -printf "%s\n" "#define HAVE_LONG_DOUBLE_WIDER 1" >>confdefs.h + if test x$ax_cxx_compile_cxx14_required = xtrue; then + if test x$ac_success = xno; then + as_fn_error $? "*** A compiler with support for C++14 language features is required." "$LINENO" 5 + fi + fi + if test x$ac_success = xno; then + HAVE_CXX14=0 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: No compiler with C++14 support was found" >&5 +printf "%s\n" "$as_me: No compiler with C++14 support was found" >&6;} + else + HAVE_CXX14=1 + +printf "%s\n" "#define HAVE_CXX14 1" >>confdefs.h fi -HAVE_FLOAT128=0 -if test x$HAVE_HAVE_LONG_DOUBLE_WIDER = x1 +if test x$HAVE_CXX14 != x1 then : - HAVE_FLOAT128=0 + ax_cxx_compile_alternatives="11 0x" ax_cxx_compile_cxx11_required=true + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + ac_success=no -fi -# -# NUMA -# -# Check whether --enable-numa was given. -if test ${enable_numa+y} -then : - enableval=$enable_numa; enable_numa=no -else $as_nop - enable_numa=yes -fi -HAVE_NUMA=0 -if test x$enable_numa != xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for numa_node_of_cpu in -lnuma" >&5 -printf %s "checking for numa_node_of_cpu in -lnuma... " >&6; } -if test ${ac_cv_lib_numa_numa_node_of_cpu+y} + if test x$ac_success = xno; then + for alternative in ${ax_cxx_compile_alternatives}; do + for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}"; do + cachevar=`printf "%s\n" "ax_cv_cxx_compile_cxx11_$switch" | $as_tr_sh` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features with $switch" >&5 +printf %s "checking whether $CXX supports C++11 features with $switch... " >&6; } +if eval test \${$cachevar+y} then : printf %s "(cached) " >&6 else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-lnuma $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + ac_save_CXX="$CXX" + CXX="$CXX $switch" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -namespace conftest { - extern "C" int numa_node_of_cpu (); -} -int -main (void) -{ -return conftest::numa_node_of_cpu (); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO" -then : - ac_cv_lib_numa_numa_node_of_cpu=yes -else $as_nop - ac_cv_lib_numa_numa_node_of_cpu=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_numa_numa_node_of_cpu" >&5 -printf "%s\n" "$ac_cv_lib_numa_numa_node_of_cpu" >&6; } -if test "x$ac_cv_lib_numa_numa_node_of_cpu" = xyes -then : - HAVE_NUMA=1 - LIBS="$LIBS -lnuma" -fi +// If the compiler admits that it is not ready for C++11, why torture it? +// Hopefully, this will speed up the test. -fi +#ifndef __cplusplus -# -# HWLOC -# +#error "This is not a C++ compiler" -# Check whether --enable-hwloc was given. -if test ${enable_hwloc+y} -then : - enableval=$enable_hwloc; enable_hwloc=no -else $as_nop - enable_hwloc=yes -fi +#elif __cplusplus < 201103L -HAVE_HWLOC=0 +#error "This is not a C++11 compiler" -if test x$enable_hwloc != xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for hwloc_topology_init in -lhwloc" >&5 -printf %s "checking for hwloc_topology_init in -lhwloc... " >&6; } -if test ${ac_cv_lib_hwloc_hwloc_topology_init+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-lhwloc $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +#else -namespace conftest { - extern "C" int hwloc_topology_init (); -} -int -main (void) +namespace cxx11 { -return conftest::hwloc_topology_init (); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO" -then : - ac_cv_lib_hwloc_hwloc_topology_init=yes -else $as_nop - ac_cv_lib_hwloc_hwloc_topology_init=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hwloc_hwloc_topology_init" >&5 -printf "%s\n" "$ac_cv_lib_hwloc_hwloc_topology_init" >&6; } -if test "x$ac_cv_lib_hwloc_hwloc_topology_init" = xyes -then : - HAVE_HWLOC=1 - LIBS="$LIBS -lhwloc" -fi + namespace test_static_assert + { -fi + template + struct check + { + static_assert(sizeof(int) <= sizeof(T), "not big enough"); + }; -# -# VMA -# + } -# Check whether --enable-vma was given. -if test ${enable_vma+y} -then : - enableval=$enable_vma; enable_vma=yes -else $as_nop - enable_vma=no -fi + namespace test_final_override + { -HAVE_VMA=0 + struct Base + { + virtual ~Base() {} + virtual void f() {} + }; -if test x$enable_vma != xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for recvfrom_zcopy in -lvma" >&5 -printf %s "checking for recvfrom_zcopy in -lvma... " >&6; } -if test ${ac_cv_lib_vma_recvfrom_zcopy+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-lvma $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + struct Derived : public Base + { + virtual ~Derived() override {} + virtual void f() override {} + }; -namespace conftest { - extern "C" int recvfrom_zcopy (); -} -int -main (void) -{ -return conftest::recvfrom_zcopy (); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO" -then : - ac_cv_lib_vma_recvfrom_zcopy=yes -else $as_nop - ac_cv_lib_vma_recvfrom_zcopy=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_vma_recvfrom_zcopy" >&5 -printf "%s\n" "$ac_cv_lib_vma_recvfrom_zcopy" >&6; } -if test "x$ac_cv_lib_vma_recvfrom_zcopy" = xyes -then : - HAVE_VMA=1 + } - LIBS="$LIBS -lvma" -fi + namespace test_double_right_angle_brackets + { -fi + template < typename T > + struct check {}; -# -# CUDA -# + typedef check single_type; + typedef check> double_type; + typedef check>> triple_type; + typedef check>>> quadruple_type; -################################# -# NOTE # -# This needs to come after all # -# other compiler/library tests # -# since it changes LIB to # -# include CUDA-specific entries # -################################# + } + namespace test_decltype + { + int + f() + { + int a = 1; + decltype(a) b = 2; + return a + b; + } + } -# Check whether --with-cuda_home was given. -if test ${with_cuda_home+y} -then : - withval=$with_cuda_home; -else $as_nop - with_cuda_home=/usr/local/cuda -fi + namespace test_type_deduction + { - CUDA_HOME=$with_cuda_home + template < typename T1, typename T2 > + struct is_same + { + static const bool value = false; + }; + template < typename T > + struct is_same + { + static const bool value = true; + }; - # Check whether --enable-cuda was given. -if test ${enable_cuda+y} -then : - enableval=$enable_cuda; enable_cuda=no -else $as_nop - enable_cuda=yes -fi + template < typename T1, typename T2 > + auto + add(T1 a1, T2 a2) -> decltype(a1 + a2) + { + return a1 + a2; + } + int + test(const int c, volatile int v) + { + static_assert(is_same::value == true, ""); + static_assert(is_same::value == false, ""); + static_assert(is_same::value == false, ""); + auto ac = c; + auto av = v; + auto sumi = ac + av + 'x'; + auto sumf = ac + av + 1.0; + static_assert(is_same::value == true, ""); + static_assert(is_same::value == true, ""); + static_assert(is_same::value == true, ""); + static_assert(is_same::value == false, ""); + static_assert(is_same::value == true, ""); + return (sumf > 0.0) ? sumi : add(c, v); + } - HAVE_CUDA=0 + } - CUDA_VERSION=0 + namespace test_noexcept + { - GPU_MAX_ARCH=0 + int f() { return 0; } + int g() noexcept { return 0; } - if test "$enable_cuda" != "no"; then - HAVE_CUDA=1 + static_assert(noexcept(f()) == false, ""); + static_assert(noexcept(g()) == true, ""); + } - # Extract the first word of "nvcc", so it can be a program name with args. -set dummy nvcc; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_NVCC+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $NVCC in - [\\/]* | ?:[\\/]*) - ac_cv_path_NVCC="$NVCC" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -as_dummy="$CUDA_HOME/bin:$PATH" -for as_dir in $as_dummy -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_NVCC="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS + namespace test_constexpr + { - test -z "$ac_cv_path_NVCC" && ac_cv_path_NVCC="no" - ;; -esac -fi -NVCC=$ac_cv_path_NVCC -if test -n "$NVCC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $NVCC" >&5 -printf "%s\n" "$NVCC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi + template < typename CharT > + unsigned long constexpr + strlen_c_r(const CharT *const s, const unsigned long acc) noexcept + { + return *s ? strlen_c_r(s + 1, acc + 1) : acc; + } + template < typename CharT > + unsigned long constexpr + strlen_c(const CharT *const s) noexcept + { + return strlen_c_r(s, 0UL); + } - # Extract the first word of "nvprune", so it can be a program name with args. -set dummy nvprune; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_NVPRUNE+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $NVPRUNE in - [\\/]* | ?:[\\/]*) - ac_cv_path_NVPRUNE="$NVPRUNE" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -as_dummy="$CUDA_HOME/bin:$PATH" -for as_dir in $as_dummy -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_NVPRUNE="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS + static_assert(strlen_c("") == 0UL, ""); + static_assert(strlen_c("1") == 1UL, ""); + static_assert(strlen_c("example") == 7UL, ""); + static_assert(strlen_c("another\0example") == 7UL, ""); - test -z "$ac_cv_path_NVPRUNE" && ac_cv_path_NVPRUNE="no" - ;; -esac -fi -NVPRUNE=$ac_cv_path_NVPRUNE -if test -n "$NVPRUNE"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $NVPRUNE" >&5 -printf "%s\n" "$NVPRUNE" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi + } + namespace test_rvalue_references + { - # Extract the first word of "cuobjdump", so it can be a program name with args. -set dummy cuobjdump; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_CUOBJDUMP+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $CUOBJDUMP in - [\\/]* | ?:[\\/]*) - ac_cv_path_CUOBJDUMP="$CUOBJDUMP" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -as_dummy="$CUDA_HOME/bin:$PATH" -for as_dir in $as_dummy -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_CUOBJDUMP="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS + template < int N > + struct answer + { + static constexpr int value = N; + }; - test -z "$ac_cv_path_CUOBJDUMP" && ac_cv_path_CUOBJDUMP="no" - ;; -esac -fi -CUOBJDUMP=$ac_cv_path_CUOBJDUMP -if test -n "$CUOBJDUMP"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CUOBJDUMP" >&5 -printf "%s\n" "$CUOBJDUMP" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi + answer<1> f(int&) { return answer<1>(); } + answer<2> f(const int&) { return answer<2>(); } + answer<3> f(int&&) { return answer<3>(); } + void + test() + { + int i = 0; + const int c = 0; + static_assert(decltype(f(i))::value == 1, ""); + static_assert(decltype(f(c))::value == 2, ""); + static_assert(decltype(f(0))::value == 3, ""); + } - fi + } - if test "$HAVE_CUDA" = "1"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a working CUDA installation" >&5 -printf %s "checking for a working CUDA installation... " >&6; } + namespace test_uniform_initialization + { - CXXFLAGS_save="$CXXFLAGS" - LDFLAGS_save="$LDFLAGS" - LIBS_save="$LIBS" + struct test + { + static const int zero {}; + static const int one {1}; + }; - ac_compile='$NVCC -c $NVCCFLAGS conftest.$ac_ext >&5' - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + static_assert(test::zero == 0, ""); + static_assert(test::one == 1, ""); + } - #include - #include -int -main (void) -{ -cudaMalloc(0, 0); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : + namespace test_lambdas + { -else $as_nop - HAVE_CUDA=0 + void + test1() + { + auto lambda1 = [](){}; + auto lambda2 = lambda1; + lambda1(); + lambda2(); + } -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + int + test2() + { + auto a = [](int i, int j){ return i + j; }(1, 2); + auto b = []() -> int { return '0'; }(); + auto c = [=](){ return a + b; }(); + auto d = [&](){ return c; }(); + auto e = [a, &b](int x) mutable { + const auto identity = [](int y){ return y; }; + for (auto i = 0; i < a; ++i) + a += b--; + return x + identity(a + b); + }(0); + return a + b + c + d + e; + } - if test "$HAVE_CUDA" = "1"; then - LDFLAGS="-L$CUDA_HOME/lib64 -L$CUDA_HOME/lib" - LIBS="$LIBS -lcuda -lcudart" + int + test3() + { + const auto nullary = [](){ return 0; }; + const auto unary = [](int x){ return x; }; + using nullary_t = decltype(nullary); + using unary_t = decltype(unary); + const auto higher1st = [](nullary_t f){ return f(); }; + const auto higher2nd = [unary](nullary_t f1){ + return [unary, f1](unary_t f2){ return f2(unary(f1())); }; + }; + return higher1st(nullary) + higher2nd(nullary)(unary); + } - ac_link='$NVCC -o conftest$ac_exeext $NVCCFLAGS $LDFLAGS $LIBS conftest.$ac_ext >&5' - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + } + namespace test_variadic_templates + { - #include - #include -int -main (void) -{ -cudaMalloc(0, 0); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO" -then : - CUDA_VERSION=$( ${NVCC} --version | ${GREP} -Po -e "release.*," | cut -d, -f1 | cut -d\ -f2 ) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes - v$CUDA_VERSION" >&5 -printf "%s\n" "yes - v$CUDA_VERSION" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - HAVE_CUDA=0 + template + struct sum; -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - HAVE_CUDA=0 + template + struct sum + { + static constexpr auto value = N0 + sum::value; + }; - fi + template <> + struct sum<> + { + static constexpr auto value = 0; + }; - CXXFLAGS="$CXXFLAGS_save" - LDFLAGS="$LDFLAGS_save" - LIBS="$LIBS_save" - fi + static_assert(sum<>::value == 0, ""); + static_assert(sum<1>::value == 1, ""); + static_assert(sum<23>::value == 23, ""); + static_assert(sum<1, 2>::value == 3, ""); + static_assert(sum<5, 5, 11>::value == 21, ""); + static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); + } -# Check whether --with-nvcc_flags was given. -if test ${with_nvcc_flags+y} + // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae + // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function + // because of this. + namespace test_template_alias_sfinae + { + + struct foo {}; + + template + using member = typename T::member_type; + + template + void func(...) {} + + template + void func(member*) {} + + void test(); + + void test() { func(0); } + + } + +} // namespace cxx11 + +#endif // __cplusplus >= 201103L + + + +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" then : - withval=$with_nvcc_flags; + eval $cachevar=yes else $as_nop - with_nvcc_flags='-O3 -Xcompiler "-Wall"' + eval $cachevar=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + CXX="$ac_save_CXX" fi +eval ac_res=\$$cachevar + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test x\$$cachevar = xyes; then + CXX="$CXX $switch" + if test -n "$CXXCPP" ; then + CXXCPP="$CXXCPP $switch" + fi + ac_success=yes + break + fi + done + if test x$ac_success = xyes; then + break + fi + done + fi + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - NVCCFLAGS=$with_nvcc_flags + if test x$ax_cxx_compile_cxx11_required = xtrue; then + if test x$ac_success = xno; then + as_fn_error $? "*** A compiler with support for C++11 language features is required." "$LINENO" 5 + fi + fi + if test x$ac_success = xno; then + HAVE_CXX11=0 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: No compiler with C++11 support was found" >&5 +printf "%s\n" "$as_me: No compiler with C++11 support was found" >&6;} + else + HAVE_CXX11=1 +printf "%s\n" "#define HAVE_CXX11 1" >>confdefs.h - if test "$HAVE_CUDA" = "1"; then - CPPFLAGS="$CPPFLAGS -DBF_CUDA_ENABLED=1" - CXXFLAGS="$CXXFLAGS -DBF_CUDA_ENABLED=1" - NVCCFLAGS="$NVCCFLAGS -DBF_CUDA_ENABLED=1" - LDFLAGS="$LDFLAGS -L$CUDA_HOME/lib64 -L$CUDA_HOME/lib" - LIBS="$LIBS -lcuda -lcudart -lnvrtc -lcublas -lcudadevrt -L. -lcufft_static_pruned -lculibos -lnvToolsExt" fi -# Check whether --with-gpu_archs was given. -if test ${with_gpu_archs+y} -then : - withval=$with_gpu_archs; -else $as_nop - with_gpu_archs='auto' fi +ac_fn_cxx_check_func "$LINENO" "memset" "ac_cv_func_memset" +if test "x$ac_cv_func_memset" = xyes +then : + printf "%s\n" "#define HAVE_MEMSET 1" >>confdefs.h - if test "$HAVE_CUDA" = "1"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for valid CUDA architectures" >&5 -printf %s "checking for valid CUDA architectures... " >&6; } - ar_supported=$( ${NVCC} -h | ${GREP} -Po "'compute_[0-9]{2,3}" | cut -d_ -f2 | sort | uniq ) - ar_supported_flat=$( echo $ar_supported | xargs ) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: found: $ar_supported_flat" >&5 -printf "%s\n" "found: $ar_supported_flat" >&6; } +fi - if test "$with_gpu_archs" = "auto"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking which CUDA architectures to target" >&5 -printf %s "checking which CUDA architectures to target... " >&6; } +ac_fn_cxx_check_func "$LINENO" "rint" "ac_cv_func_rint" +if test "x$ac_cv_func_rint" = xyes +then : + printf "%s\n" "#define HAVE_RINT 1" >>confdefs.h - CXXFLAGS_save="$CXXFLAGS" - LDFLAGS_save="$LDFLAGS" - LIBS_save="$LIBS" +fi - LDFLAGS="-L$CUDA_HOME/lib64 -L$CUDA_HOME/lib" - LIBS="-lcuda -lcudart" - ac_run='$NVCC -o conftest$ac_ext $LDFLAGS $LIBS conftest.$ac_ext>&5' - if test "$cross_compiling" = yes +ac_fn_cxx_check_func "$LINENO" "socket" "ac_cv_func_socket" +if test "x$ac_cv_func_socket" = xyes then : - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run test program while cross compiling -See \`config.log' for more details" "$LINENO" 5; } -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + printf "%s\n" "#define HAVE_SOCKET 1" >>confdefs.h +fi - #include - #include - #include - #include - #include -int -main (void) -{ - std::set archs; - int major, minor, arch; - int deviceCount = 0; - cudaGetDeviceCount(&deviceCount); - if( deviceCount == 0 ) { - return 1; - } - std::ofstream fh; - fh.open("confarchs.out"); - for(int dev=0; dev 0 ) { - fh << " "; - } - fh << arch; - } - arch += minor; - if( archs.count(arch) == 0 ) { - archs.insert(arch); - fh << " " << arch; - } - } - fh.close(); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_run "$LINENO" + for ac_func in recvmsg +do : + ac_fn_cxx_check_func "$LINENO" "recvmsg" "ac_cv_func_recvmsg" +if test "x$ac_cv_func_recvmsg" = xyes then : - GPU_ARCHS=`cat confarchs.out` - - ar_supported=$( ${NVCC} -h | ${GREP} -Po "'compute_[0-9]{2,3}" | cut -d_ -f2 | sort | uniq ) - ar_valid=$( echo $GPU_ARCHS $ar_supported | xargs -n1 | sort | uniq -d | xargs ) - if test "$ar_valid" = ""; then - as_fn_error $? "failed to find any supported" "$LINENO" 5 - else - GPU_ARCHS=$ar_valid + printf "%s\n" "#define HAVE_RECVMSG 1" >>confdefs.h + HAVE_RECVMSG=1 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $GPU_ARCHS" >&5 -printf "%s\n" "$GPU_ARCHS" >&6; } - fi else $as_nop - as_fn_error $? "failed to find any" "$LINENO" 5 + HAVE_RECVMSG=0 + fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + +done +ac_fn_cxx_check_func "$LINENO" "sqrt" "ac_cv_func_sqrt" +if test "x$ac_cv_func_sqrt" = xyes +then : + printf "%s\n" "#define HAVE_SQRT 1" >>confdefs.h + fi +ac_fn_cxx_check_func "$LINENO" "strerror" "ac_cv_func_strerror" +if test "x$ac_cv_func_strerror" = xyes +then : + printf "%s\n" "#define HAVE_STRERROR 1" >>confdefs.h - CXXFLAGS="$CXXFLAGS_save" - LDFLAGS="$LDFLAGS_save" - LIBS="$LIBS_save" - else - GPU_ARCHS=$with_gpu_archs +fi - fi +ac_fn_cxx_check_header_compile "$LINENO" "arpa/inet.h" "ac_cv_header_arpa_inet_h" "$ac_includes_default" +if test "x$ac_cv_header_arpa_inet_h" = xyes +then : + printf "%s\n" "#define HAVE_ARPA_INET_H 1" >>confdefs.h - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for valid requested CUDA architectures" >&5 -printf %s "checking for valid requested CUDA architectures... " >&6; } - ar_requested=$( echo "$GPU_ARCHS" | wc -w ) - ar_valid=$( echo $GPU_ARCHS $ar_supported | xargs -n1 | sort | uniq -d | xargs ) - ar_found=$( echo $ar_valid | wc -w ) - if test "$ar_requested" = "$ar_found"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } - else - as_fn_error $? "only '$ar_valid' are supported" "$LINENO" 5 - fi +fi - ar_max_valid=$(echo $ar_valid | ${SED} -e 's/.* //g;' ) - GPU_MAX_ARCH=$ar_max_valid +ac_fn_cxx_check_header_compile "$LINENO" "netdb.h" "ac_cv_header_netdb_h" "$ac_includes_default" +if test "x$ac_cv_header_netdb_h" = xyes +then : + printf "%s\n" "#define HAVE_NETDB_H 1" >>confdefs.h +fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Pascal-style CUDA managed memory" >&5 -printf %s "checking for Pascal-style CUDA managed memory... " >&6; } - cm_invalid=$( echo $GPU_ARCHS | ${SED} -e 's/\b[1-5][0-9]\b/PRE/g;' ) - if ! echo $cm_invalid | ${GREP} -q PRE; then - GPU_PASCAL_MANAGEDMEM=1 +ac_fn_cxx_check_header_compile "$LINENO" "netinet/in.h" "ac_cv_header_netinet_in_h" "$ac_includes_default" +if test "x$ac_cv_header_netinet_in_h" = xyes +then : + printf "%s\n" "#define HAVE_NETINET_IN_H 1" >>confdefs.h - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } - else - GPU_PASCAL_MANAGEDMEM=0 +fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - fi - else - GPU_PASCAL_MANAGEDMEM=0 +ac_fn_cxx_check_header_compile "$LINENO" "sys/file.h" "ac_cv_header_sys_file_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_file_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_FILE_H 1" >>confdefs.h - fi +fi +ac_fn_cxx_check_header_compile "$LINENO" "sys/ioctl.h" "ac_cv_header_sys_ioctl_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_ioctl_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_IOCTL_H 1" >>confdefs.h +fi -# Check whether --with-shared_mem was given. -if test ${with_shared_mem+y} +ac_fn_cxx_check_header_compile "$LINENO" "sys/socket.h" "ac_cv_header_sys_socket_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_socket_h" = xyes then : - withval=$with_shared_mem; + printf "%s\n" "#define HAVE_SYS_SOCKET_H 1" >>confdefs.h + +fi + +ac_fn_cxx_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default" +if test "x$ac_cv_type__Bool" = xyes +then : + +printf "%s\n" "#define HAVE__BOOL 1" >>confdefs.h + + +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5 +printf %s "checking for stdbool.h that conforms to C99... " >&6; } +if test ${ac_cv_header_stdbool_h+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + + #ifndef __bool_true_false_are_defined + #error "__bool_true_false_are_defined is not defined" + #endif + char a[__bool_true_false_are_defined == 1 ? 1 : -1]; + + /* Regardless of whether this is C++ or "_Bool" is a + valid type name, "true" and "false" should be usable + in #if expressions and integer constant expressions, + and "bool" should be a valid type name. */ + + #if !true + #error "'true' is not true" + #endif + #if true != 1 + #error "'true' is not equal to 1" + #endif + char b[true == 1 ? 1 : -1]; + char c[true]; + + #if false + #error "'false' is not false" + #endif + #if false != 0 + #error "'false' is not equal to 0" + #endif + char d[false == 0 ? 1 : -1]; + + enum { e = false, f = true, g = false * true, h = true * 256 }; + + char i[(bool) 0.5 == true ? 1 : -1]; + char j[(bool) 0.0 == false ? 1 : -1]; + char k[sizeof (bool) > 0 ? 1 : -1]; + + struct sb { bool s: 1; bool t; } s; + char l[sizeof s.t > 0 ? 1 : -1]; + + /* The following fails for + HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ + bool m[h]; + char n[sizeof m == h * sizeof m[0] ? 1 : -1]; + char o[-1 - (bool) 0 < 0 ? 1 : -1]; + /* Catch a bug in an HP-UX C compiler. See + https://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html + https://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html + */ + bool p = true; + bool *pp = &p; + + /* C 1999 specifies that bool, true, and false are to be + macros, but C++ 2011 and later overrule this. */ + #if __cplusplus < 201103 + #ifndef bool + #error "bool is not defined" + #endif + #ifndef false + #error "false is not defined" + #endif + #ifndef true + #error "true is not defined" + #endif + #endif + + /* If _Bool is available, repeat with it all the tests + above that used bool. */ + #ifdef HAVE__BOOL + struct sB { _Bool s: 1; _Bool t; } t; + + char q[(_Bool) 0.5 == true ? 1 : -1]; + char r[(_Bool) 0.0 == false ? 1 : -1]; + char u[sizeof (_Bool) > 0 ? 1 : -1]; + char v[sizeof t.t > 0 ? 1 : -1]; + + _Bool w[h]; + char x[sizeof m == h * sizeof m[0] ? 1 : -1]; + char y[-1 - (_Bool) 0 < 0 ? 1 : -1]; + _Bool z = true; + _Bool *pz = &p; + #endif + +int +main (void) +{ + + bool ps = &s; + *pp |= p; + *pp |= ! p; + + #ifdef HAVE__BOOL + _Bool pt = &t; + *pz |= z; + *pz |= ! z; + #endif + + /* Refer to every declared value, so they cannot be + discarded as unused. */ + return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !j + !k + + !l + !m + !n + !o + !p + !pp + !ps + #ifdef HAVE__BOOL + + !q + !r + !u + !v + !w + !x + !y + !z + !pt + #endif + ); + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + ac_cv_header_stdbool_h=yes +else $as_nop + ac_cv_header_stdbool_h=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5 +printf "%s\n" "$ac_cv_header_stdbool_h" >&6; } + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5 +printf %s "checking for GNU libc compatible malloc... " >&6; } +if test ${ac_cv_func_malloc_0_nonnull+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test "$cross_compiling" = yes +then : + case "$host_os" in # (( + # Guess yes on platforms where we know the result. + *-gnu* | freebsd* | netbsd* | openbsd* | bitrig* \ + | hpux* | solaris* | cygwin* | mingw* | msys* ) + ac_cv_func_malloc_0_nonnull=yes ;; + # If we don't know, assume the worst. + *) ac_cv_func_malloc_0_nonnull=no ;; + esac +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +void *p = malloc (0); + int result = !p; + free (p); + return result; + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_run "$LINENO" +then : + ac_cv_func_malloc_0_nonnull=yes +else $as_nop + ac_cv_func_malloc_0_nonnull=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5 +printf "%s\n" "$ac_cv_func_malloc_0_nonnull" >&6; } +if test $ac_cv_func_malloc_0_nonnull = yes +then : + +printf "%s\n" "#define HAVE_MALLOC 1" >>confdefs.h + +else $as_nop + printf "%s\n" "#define HAVE_MALLOC 0" >>confdefs.h + + case " $LIBOBJS " in + *" malloc.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS malloc.$ac_objext" + ;; +esac + + +printf "%s\n" "#define malloc rpl_malloc" >>confdefs.h + +fi + + + +HAVE_OPENMP=0 + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for OpenMP flag of C++ compiler" >&5 +printf %s "checking for OpenMP flag of C++ compiler... " >&6; } +if test ${ax_cv_cxx_openmp+y} +then : + printf %s "(cached) " >&6 +else $as_nop + saveCXXFLAGS=$CXXFLAGS +ax_cv_cxx_openmp=unknown +# Flags to try: -fopenmp (gcc), -mp (SGI & PGI), +# -qopenmp (icc>=15), -openmp (icc), +# -xopenmp (Sun), -omp (Tru64), +# -qsmp=omp (AIX), +# none +ax_openmp_flags="-fopenmp -openmp -qopenmp -mp -xopenmp -omp -qsmp=omp none" +if test "x$OPENMP_CXXFLAGS" != x; then + ax_openmp_flags="$OPENMP_CXXFLAGS $ax_openmp_flags" +fi +for ax_openmp_flag in $ax_openmp_flags; do + case $ax_openmp_flag in + none) CXXFLAGS=$saveCXX ;; + *) CXXFLAGS="$saveCXXFLAGS $ax_openmp_flag" ;; + esac + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include + +static void +parallel_fill(int * data, int n) +{ + int i; +#pragma omp parallel for + for (i = 0; i < n; ++i) + data[i] = i; +} + +int +main() +{ + int arr[100000]; + omp_set_num_threads(2); + parallel_fill(arr, 100000); + return 0; +} + +_ACEOF +if ac_fn_cxx_try_link "$LINENO" +then : + ax_cv_cxx_openmp=$ax_openmp_flag; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +done +CXXFLAGS=$saveCXXFLAGS + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cxx_openmp" >&5 +printf "%s\n" "$ax_cv_cxx_openmp" >&6; } +if test "x$ax_cv_cxx_openmp" = "xunknown"; then + : +else + if test "x$ax_cv_cxx_openmp" != "xnone"; then + OPENMP_CXXFLAGS=$ax_cv_cxx_openmp + fi + +printf "%s\n" "#define HAVE_OPENMP 1" >>confdefs.h + +fi + +if test x$OPENMP_CXXFLAGS != x +then : + HAVE_OPENMP=1 + +fi +if test x$HAVE_OPENMP != x1 +then : + +else $as_nop + CXXFLAGS="$CXXFLAGS $OPENMP_CXXFLAGS" + LDFLAGS="$LDFLAGS $OPENMP_CXXFLAGS" +fi + +ac_fn_cxx_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default" +if test "x$ac_cv_type_ptrdiff_t" = xyes +then : + +printf "%s\n" "#define HAVE_PTRDIFF_T 1" >>confdefs.h + + +fi + +ac_fn_c_find_intX_t "$LINENO" "16" "ac_cv_c_int16_t" +case $ac_cv_c_int16_t in #( + no|yes) ;; #( + *) + +printf "%s\n" "#define int16_t $ac_cv_c_int16_t" >>confdefs.h +;; +esac + +ac_fn_c_find_intX_t "$LINENO" "32" "ac_cv_c_int32_t" +case $ac_cv_c_int32_t in #( + no|yes) ;; #( + *) + +printf "%s\n" "#define int32_t $ac_cv_c_int32_t" >>confdefs.h +;; +esac + +ac_fn_c_find_intX_t "$LINENO" "64" "ac_cv_c_int64_t" +case $ac_cv_c_int64_t in #( + no|yes) ;; #( + *) + +printf "%s\n" "#define int64_t $ac_cv_c_int64_t" >>confdefs.h +;; +esac + +ac_fn_c_find_intX_t "$LINENO" "8" "ac_cv_c_int8_t" +case $ac_cv_c_int8_t in #( + no|yes) ;; #( + *) + +printf "%s\n" "#define int8_t $ac_cv_c_int8_t" >>confdefs.h +;; +esac + + + ac_fn_cxx_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default +" +if test "x$ac_cv_type_pid_t" = xyes +then : + +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #if defined _WIN64 && !defined __CYGWIN__ + LLP64 + #endif + +int +main (void) +{ + + ; + return 0; +} + +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + ac_pid_type='int' +else $as_nop + ac_pid_type='__int64' +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + +printf "%s\n" "#define pid_t $ac_pid_type" >>confdefs.h + + +fi + + +ac_fn_cxx_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" +if test "x$ac_cv_type_size_t" = xyes +then : + +else $as_nop + +printf "%s\n" "#define size_t unsigned int" >>confdefs.h + +fi + +ac_fn_cxx_check_type "$LINENO" "ssize_t" "ac_cv_type_ssize_t" "$ac_includes_default" +if test "x$ac_cv_type_ssize_t" = xyes +then : + +else $as_nop + +printf "%s\n" "#define ssize_t int" >>confdefs.h + +fi + +ac_fn_c_find_uintX_t "$LINENO" "16" "ac_cv_c_uint16_t" +case $ac_cv_c_uint16_t in #( + no|yes) ;; #( + *) + + +printf "%s\n" "#define uint16_t $ac_cv_c_uint16_t" >>confdefs.h +;; + esac + +ac_fn_c_find_uintX_t "$LINENO" "32" "ac_cv_c_uint32_t" +case $ac_cv_c_uint32_t in #( + no|yes) ;; #( + *) + +printf "%s\n" "#define _UINT32_T 1" >>confdefs.h + + +printf "%s\n" "#define uint32_t $ac_cv_c_uint32_t" >>confdefs.h +;; + esac + +ac_fn_c_find_uintX_t "$LINENO" "64" "ac_cv_c_uint64_t" +case $ac_cv_c_uint64_t in #( + no|yes) ;; #( + *) + +printf "%s\n" "#define _UINT64_T 1" >>confdefs.h + + +printf "%s\n" "#define uint64_t $ac_cv_c_uint64_t" >>confdefs.h +;; + esac + +ac_fn_c_find_uintX_t "$LINENO" "8" "ac_cv_c_uint8_t" +case $ac_cv_c_uint8_t in #( + no|yes) ;; #( + *) + +printf "%s\n" "#define _UINT8_T 1" >>confdefs.h + + +printf "%s\n" "#define uint8_t $ac_cv_c_uint8_t" >>confdefs.h +;; + esac + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for long double with more range or precision than double" >&5 +printf %s "checking for long double with more range or precision than double... " >&6; } +if test ${ac_cv_type_long_double_wider+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + long double const a[] = + { + 0.0L, DBL_MIN, DBL_MAX, DBL_EPSILON, + LDBL_MIN, LDBL_MAX, LDBL_EPSILON + }; + long double + f (long double x) + { + return ((x + (unsigned long int) 10) * (-1 / x) + a[0] + + (x ? f (x) : 'c')); + } + +int +main (void) +{ +static int test_array [1 - 2 * !((0 < ((DBL_MAX_EXP < LDBL_MAX_EXP) + + (DBL_MANT_DIG < LDBL_MANT_DIG) + - (LDBL_MAX_EXP < DBL_MAX_EXP) + - (LDBL_MANT_DIG < DBL_MANT_DIG))) + && (int) LDBL_EPSILON == 0 + )]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + ac_cv_type_long_double_wider=yes +else $as_nop + ac_cv_type_long_double_wider=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_double_wider" >&5 +printf "%s\n" "$ac_cv_type_long_double_wider" >&6; } + if test $ac_cv_type_long_double_wider = yes; then + +printf "%s\n" "#define HAVE_LONG_DOUBLE_WIDER 1" >>confdefs.h + + fi + +HAVE_FLOAT128=0 + +if test x$HAVE_HAVE_LONG_DOUBLE_WIDER = x1 +then : + HAVE_FLOAT128=0 + +fi + +# +# NUMA +# + +# Check whether --enable-numa was given. +if test ${enable_numa+y} +then : + enableval=$enable_numa; enable_numa=no +else $as_nop + enable_numa=yes +fi + +HAVE_NUMA=0 + +if test x$enable_numa != xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for numa_node_of_cpu in -lnuma" >&5 +printf %s "checking for numa_node_of_cpu in -lnuma... " >&6; } +if test ${ac_cv_lib_numa_numa_node_of_cpu+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lnuma $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +namespace conftest { + extern "C" int numa_node_of_cpu (); +} +int +main (void) +{ +return conftest::numa_node_of_cpu (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO" +then : + ac_cv_lib_numa_numa_node_of_cpu=yes +else $as_nop + ac_cv_lib_numa_numa_node_of_cpu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_numa_numa_node_of_cpu" >&5 +printf "%s\n" "$ac_cv_lib_numa_numa_node_of_cpu" >&6; } +if test "x$ac_cv_lib_numa_numa_node_of_cpu" = xyes +then : + HAVE_NUMA=1 + + LIBS="$LIBS -lnuma" +fi + +fi + +# +# HWLOC +# + +# Check whether --enable-hwloc was given. +if test ${enable_hwloc+y} +then : + enableval=$enable_hwloc; enable_hwloc=no +else $as_nop + enable_hwloc=yes +fi + +HAVE_HWLOC=0 + +if test x$enable_hwloc != xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for hwloc_topology_init in -lhwloc" >&5 +printf %s "checking for hwloc_topology_init in -lhwloc... " >&6; } +if test ${ac_cv_lib_hwloc_hwloc_topology_init+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lhwloc $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +namespace conftest { + extern "C" int hwloc_topology_init (); +} +int +main (void) +{ +return conftest::hwloc_topology_init (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO" +then : + ac_cv_lib_hwloc_hwloc_topology_init=yes +else $as_nop + ac_cv_lib_hwloc_hwloc_topology_init=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hwloc_hwloc_topology_init" >&5 +printf "%s\n" "$ac_cv_lib_hwloc_hwloc_topology_init" >&6; } +if test "x$ac_cv_lib_hwloc_hwloc_topology_init" = xyes +then : + HAVE_HWLOC=1 + + LIBS="$LIBS -lhwloc" +fi + +fi + +# +# VMA +# + +# Check whether --enable-vma was given. +if test ${enable_vma+y} +then : + enableval=$enable_vma; enable_vma=yes +else $as_nop + enable_vma=no +fi + +HAVE_VMA=0 + +if test x$enable_vma != xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for recvfrom_zcopy in -lvma" >&5 +printf %s "checking for recvfrom_zcopy in -lvma... " >&6; } +if test ${ac_cv_lib_vma_recvfrom_zcopy+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lvma $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +namespace conftest { + extern "C" int recvfrom_zcopy (); +} +int +main (void) +{ +return conftest::recvfrom_zcopy (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO" +then : + ac_cv_lib_vma_recvfrom_zcopy=yes +else $as_nop + ac_cv_lib_vma_recvfrom_zcopy=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_vma_recvfrom_zcopy" >&5 +printf "%s\n" "$ac_cv_lib_vma_recvfrom_zcopy" >&6; } +if test "x$ac_cv_lib_vma_recvfrom_zcopy" = xyes +then : + HAVE_VMA=1 + + LIBS="$LIBS -lvma" +fi + +fi + +# +# CUDA +# + +################################# +# NOTE # +# This needs to come after all # +# other compiler/library tests # +# since it changes LIB to # +# include CUDA-specific entries # +################################# + + + + +# Check whether --with-cuda_home was given. +if test ${with_cuda_home+y} +then : + withval=$with_cuda_home; +else $as_nop + with_cuda_home=/usr/local/cuda +fi + + CUDA_HOME=$with_cuda_home + + + # Check whether --enable-cuda was given. +if test ${enable_cuda+y} +then : + enableval=$enable_cuda; enable_cuda=no +else $as_nop + enable_cuda=yes +fi + + + HAVE_CUDA=0 + + CUDA_VERSION=0 + + GPU_MAX_ARCH=0 + + if test "$enable_cuda" != "no"; then + HAVE_CUDA=1 + + + # Extract the first word of "nvcc", so it can be a program name with args. +set dummy nvcc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_NVCC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $NVCC in + [\\/]* | ?:[\\/]*) + ac_cv_path_NVCC="$NVCC" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$CUDA_HOME/bin:$PATH" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_NVCC="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_NVCC" && ac_cv_path_NVCC="no" + ;; +esac +fi +NVCC=$ac_cv_path_NVCC +if test -n "$NVCC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $NVCC" >&5 +printf "%s\n" "$NVCC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + # Extract the first word of "nvprune", so it can be a program name with args. +set dummy nvprune; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_NVPRUNE+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $NVPRUNE in + [\\/]* | ?:[\\/]*) + ac_cv_path_NVPRUNE="$NVPRUNE" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$CUDA_HOME/bin:$PATH" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_NVPRUNE="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_NVPRUNE" && ac_cv_path_NVPRUNE="no" + ;; +esac +fi +NVPRUNE=$ac_cv_path_NVPRUNE +if test -n "$NVPRUNE"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $NVPRUNE" >&5 +printf "%s\n" "$NVPRUNE" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + # Extract the first word of "cuobjdump", so it can be a program name with args. +set dummy cuobjdump; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_CUOBJDUMP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $CUOBJDUMP in + [\\/]* | ?:[\\/]*) + ac_cv_path_CUOBJDUMP="$CUOBJDUMP" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$CUDA_HOME/bin:$PATH" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_CUOBJDUMP="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_CUOBJDUMP" && ac_cv_path_CUOBJDUMP="no" + ;; +esac +fi +CUOBJDUMP=$ac_cv_path_CUOBJDUMP +if test -n "$CUOBJDUMP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CUOBJDUMP" >&5 +printf "%s\n" "$CUOBJDUMP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + fi + + if test "$HAVE_CUDA" = "1"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a working CUDA installation" >&5 +printf %s "checking for a working CUDA installation... " >&6; } + + CXXFLAGS_save="$CXXFLAGS" + LDFLAGS_save="$LDFLAGS" + LIBS_save="$LIBS" + + ac_compile='$NVCC -c $NVCCFLAGS conftest.$ac_ext >&5' + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + + #include + #include +int +main (void) +{ +cudaMalloc(0, 0); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + +else $as_nop + HAVE_CUDA=0 + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + if test "$HAVE_CUDA" = "1"; then + LDFLAGS="-L$CUDA_HOME/lib64 -L$CUDA_HOME/lib" + LIBS="$LIBS -lcuda -lcudart" + + ac_link='$NVCC -o conftest$ac_exeext $NVCCFLAGS $LDFLAGS $LIBS conftest.$ac_ext >&5' + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + + #include + #include +int +main (void) +{ +cudaMalloc(0, 0); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO" +then : + CUDA_VERSION=$( ${NVCC} --version | ${GREP} -Po -e "release.*," | cut -d, -f1 | cut -d\ -f2 ) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes - v$CUDA_VERSION" >&5 +printf "%s\n" "yes - v$CUDA_VERSION" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + HAVE_CUDA=0 + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + HAVE_CUDA=0 + + fi + + CXXFLAGS="$CXXFLAGS_save" + LDFLAGS="$LDFLAGS_save" + LIBS="$LIBS_save" + fi + + +# Check whether --with-nvcc_flags was given. +if test ${with_nvcc_flags+y} +then : + withval=$with_nvcc_flags; +else $as_nop + with_nvcc_flags='-O3 -Xcompiler "-Wall"' +fi + + NVCCFLAGS=$with_nvcc_flags + + + if test "$HAVE_CUDA" = "1"; then + CPPFLAGS="$CPPFLAGS -DBF_CUDA_ENABLED=1" + CXXFLAGS="$CXXFLAGS -DBF_CUDA_ENABLED=1" + NVCCFLAGS="$NVCCFLAGS -DBF_CUDA_ENABLED=1" + LDFLAGS="$LDFLAGS -L$CUDA_HOME/lib64 -L$CUDA_HOME/lib" + LIBS="$LIBS -lcuda -lcudart -lnvrtc -lcublas -lcudadevrt -L. -lcufft_static_pruned -lculibos -lnvToolsExt" + fi + + +# Check whether --with-gpu_archs was given. +if test ${with_gpu_archs+y} +then : + withval=$with_gpu_archs; +else $as_nop + with_gpu_archs='auto' +fi + + if test "$HAVE_CUDA" = "1"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for valid CUDA architectures" >&5 +printf %s "checking for valid CUDA architectures... " >&6; } + ar_supported=$( ${NVCC} -h | ${GREP} -Po "'compute_[0-9]{2,3}" | cut -d_ -f2 | sort | uniq ) + ar_supported_flat=$( echo $ar_supported | xargs ) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: found: $ar_supported_flat" >&5 +printf "%s\n" "found: $ar_supported_flat" >&6; } + + if test "$with_gpu_archs" = "auto"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking which CUDA architectures to target" >&5 +printf %s "checking which CUDA architectures to target... " >&6; } + + CXXFLAGS_save="$CXXFLAGS" + LDFLAGS_save="$LDFLAGS" + LIBS_save="$LIBS" + + LDFLAGS="-L$CUDA_HOME/lib64 -L$CUDA_HOME/lib" + LIBS="-lcuda -lcudart" + ac_run='$NVCC -o conftest$ac_ext $LDFLAGS $LIBS conftest.$ac_ext>&5' + if test "$cross_compiling" = yes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + + #include + #include + #include + #include + #include +int +main (void) +{ + + std::set archs; + int major, minor, arch; + int deviceCount = 0; + cudaGetDeviceCount(&deviceCount); + if( deviceCount == 0 ) { + return 1; + } + std::ofstream fh; + fh.open("confarchs.out"); + for(int dev=0; dev 0 ) { + fh << " "; + } + fh << arch; + } + arch += minor; + if( archs.count(arch) == 0 ) { + archs.insert(arch); + fh << " " << arch; + } + } + fh.close(); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_run "$LINENO" +then : + GPU_ARCHS=`cat confarchs.out` + + ar_supported=$( ${NVCC} -h | ${GREP} -Po "'compute_[0-9]{2,3}" | cut -d_ -f2 | sort | uniq ) + ar_valid=$( echo $GPU_ARCHS $ar_supported | xargs -n1 | sort | uniq -d | xargs ) + if test "$ar_valid" = ""; then + as_fn_error $? "failed to find any supported" "$LINENO" 5 + else + GPU_ARCHS=$ar_valid + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $GPU_ARCHS" >&5 +printf "%s\n" "$GPU_ARCHS" >&6; } + fi +else $as_nop + as_fn_error $? "failed to find any" "$LINENO" 5 +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + + CXXFLAGS="$CXXFLAGS_save" + LDFLAGS="$LDFLAGS_save" + LIBS="$LIBS_save" + else + GPU_ARCHS=$with_gpu_archs + + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for valid requested CUDA architectures" >&5 +printf %s "checking for valid requested CUDA architectures... " >&6; } + ar_requested=$( echo "$GPU_ARCHS" | wc -w ) + ar_valid=$( echo $GPU_ARCHS $ar_supported | xargs -n1 | sort | uniq -d | xargs ) + ar_found=$( echo $ar_valid | wc -w ) + if test "$ar_requested" = "$ar_found"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + else + as_fn_error $? "only '$ar_valid' are supported" "$LINENO" 5 + fi + + ar_max_valid=$(echo $ar_valid | ${SED} -e 's/.* //g;' ) + GPU_MAX_ARCH=$ar_max_valid + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Pascal-style CUDA managed memory" >&5 +printf %s "checking for Pascal-style CUDA managed memory... " >&6; } + cm_invalid=$( echo $GPU_ARCHS | ${SED} -e 's/\b[1-5][0-9]\b/PRE/g;' ) + if ! echo $cm_invalid | ${GREP} -q PRE; then + GPU_PASCAL_MANAGEDMEM=1 + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + else + GPU_PASCAL_MANAGEDMEM=0 + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + fi + else + GPU_PASCAL_MANAGEDMEM=0 + + fi + + + +# Check whether --with-shared_mem was given. +if test ${with_shared_mem+y} +then : + withval=$with_shared_mem; +else $as_nop + with_shared_mem=16384 +fi + +GPU_SHAREDMEM=$with_shared_mem + +if test x$HAVE_CUDA = x0 +then : + GPU_SHAREDMEM=0 + +fi + +# +# Bifrost memory alignment +# + + +# Check whether --with-alignment was given. +if test ${with_alignment+y} +then : + withval=$with_alignment; +else $as_nop + with_alignment=4096 +fi + +ALIGNMENT=$with_alignment + + +# +# Bifrost proclog location +# + + + + + +# Check whether --with-logging_dir was given. +if test ${with_logging_dir+y} +then : + withval=$with_logging_dir; HAVE_TMPFS=$with_logging_dir + +else $as_nop + HAVE_TMPFS=/tmp + +fi + + + if test "$HAVE_TMPFS" = "/tmp"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for /dev/shm" >&5 +printf %s "checking for /dev/shm... " >&6; } +if test ${ac_cv_file__dev_shm+y} +then : + printf %s "(cached) " >&6 +else $as_nop + test "$cross_compiling" = yes && + as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 +if test -r "/dev/shm"; then + ac_cv_file__dev_shm=yes +else + ac_cv_file__dev_shm=no +fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__dev_shm" >&5 +printf "%s\n" "$ac_cv_file__dev_shm" >&6; } +if test "x$ac_cv_file__dev_shm" = xyes +then : + HAVE_TMPFS=/dev/shm/bifrost + +fi + + fi + + if test "$HAVE_TMPFS" = "/tmp"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for /Volumes/RAMDisk" >&5 +printf %s "checking for /Volumes/RAMDisk... " >&6; } +if test ${ac_cv_file__Volumes_RAMDisk+y} +then : + printf %s "(cached) " >&6 +else $as_nop + test "$cross_compiling" = yes && + as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 +if test -r "/Volumes/RAMDisk"; then + ac_cv_file__Volumes_RAMDisk=yes +else + ac_cv_file__Volumes_RAMDisk=no +fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__Volumes_RAMDisk" >&5 +printf "%s\n" "$ac_cv_file__Volumes_RAMDisk" >&6; } +if test "x$ac_cv_file__Volumes_RAMDisk" = xyes +then : + HAVE_TMPFS=/Volumes/RAMDisk/bifrost + +fi + + fi + + if test "$HAVE_TMPFS" = "/tmp"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for /tmp" >&5 +printf %s "checking for /tmp... " >&6; } +if test ${ac_cv_file__tmp+y} +then : + printf %s "(cached) " >&6 +else $as_nop + test "$cross_compiling" = yes && + as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 +if test -r "/tmp"; then + ac_cv_file__tmp=yes +else + ac_cv_file__tmp=no +fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__tmp" >&5 +printf "%s\n" "$ac_cv_file__tmp" >&6; } +if test "x$ac_cv_file__tmp" = xyes +then : + HAVE_TMPFS=/tmp + +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $HAVE_TMPFS may have performance problems for logging" >&5 +printf "%s\n" "$as_me: WARNING: $HAVE_TMPFS may have performance problems for logging" >&2;} + HAVE_TMPFS=/tmp/bifrost + + fi + + +# +# Bifrost Features +# + +# Check whether --enable-debug was given. +if test ${enable_debug+y} +then : + enableval=$enable_debug; enable_debug=yes +else $as_nop + enable_debug=no +fi + +HAVE_DEBUG=0 + +if test x$enable_debug != xno +then : + HAVE_DEBUG=1 + + CXXFLAGS="$CXXFLAGS -g" + NVCCFLAGS="$NVCCFLAGS -g" +fi + +# Check whether --enable-trace was given. +if test ${enable_trace+y} +then : + enableval=$enable_trace; enable_trace=yes +else $as_nop + enable_trace=no +fi + +HAVE_TRACE=0 + +if test x$enable_trace != xno +then : + HAVE_TRACE=1 + +fi + + + + # Check whether --enable-native_arch was given. +if test ${enable_native_arch+y} +then : + enableval=$enable_native_arch; enable_native_arch=no +else $as_nop + enable_native_arch=yes +fi + + + if test "$enable_native_arch" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the compiler accepts '-march=native'" >&5 +printf %s "checking if the compiler accepts '-march=native'... " >&6; } + + CXXFLAGS_temp="$CXXFLAGS -march=native" + + ac_compile='$CXX -c $CXXFLAGS_temp conftest.$ac_ext >&5' + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + + +int +main (void) +{ + + int i = 5; + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + CXXFLAGS="$CXXFLAGS -march=native" + NVCCFLAGS="$NVCCFLAGS -Xcompiler \"-march=native\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else $as_nop + enable_native_arch=no + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + fi + + +# Check whether --enable-cuda_debug was given. +if test ${enable_cuda_debug+y} +then : + enableval=$enable_cuda_debug; enable_cuda_debug=yes +else $as_nop + enable_cuda_debug=no +fi + +HAVE_CUDA_DEBUG=0 + +if test x$enable_cuda_debug != xno +then : + HAVE_CUDA_DEBUG=1 + + NVCCFLAGS="$NVCCFLAGS -G" +fi + + + +# Check whether --with-mapped_ring_dir was given. +if test ${with_mapped_ring_dir+y} +then : + withval=$with_mapped_ring_dir; +else $as_nop + mapped_ring_dir=/tmp/bifrost_mapped +fi + +MAPPED_RING_DIR=$mapped_ring_dir + + +# +# Python +# + +# Check whether --enable-python was given. +if test ${enable_python+y} +then : + enableval=$enable_python; enable_python=no +else $as_nop + enable_python=yes +fi + +HAVE_PYTHON=0 + +if test x$enable_python != xno +then : + + + + + + + + + + + if test -z "$PYTHON" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether python executable path has been provided" >&5 +printf %s "checking whether python executable path has been provided... " >&6; } + +# Check whether --with-python was given. +if test ${with_python+y} +then : + withval=$with_python; + if test "$withval" != yes && test "$withval" != no +then : + + PYTHON="$withval" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5 +printf "%s\n" "$PYTHON" >&6; } + +else $as_nop + + PYTHON="" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + if test "$withval" != no +then : + + # Extract the first word of "python", so it can be a program name with args. +set dummy python; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_PYTHON+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $PYTHON in + [\\/]* | ?:[\\/]*) + ac_cv_path_PYTHON="$PYTHON" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_PYTHON="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_PYTHON" && ac_cv_path_PYTHON="no" + ;; +esac +fi +PYTHON=$ac_cv_path_PYTHON +if test -n "$PYTHON"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5 +printf "%s\n" "$PYTHON" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + +fi + +fi + +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + # Extract the first word of "python", so it can be a program name with args. +set dummy python; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_PYTHON+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $PYTHON in + [\\/]* | ?:[\\/]*) + ac_cv_path_PYTHON="$PYTHON" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_PYTHON="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_PYTHON" && ac_cv_path_PYTHON="no" + ;; +esac +fi +PYTHON=$ac_cv_path_PYTHON +if test -n "$PYTHON"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5 +printf "%s\n" "$PYTHON" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + +fi + + +fi + + + + + + + if test x${PYTHON} != xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $PYTHON as ctypesgen" >&5 +printf %s "checking whether $PYTHON as ctypesgen... " >&6; } + if ! ${PYTHON} -c "import ctypesgen" 2>/dev/null +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: python module will not be built" >&5 +printf "%s\n" "$as_me: WARNING: python module will not be built" >&2;} +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + HAVE_PYTHON=1 + +fi +fi +fi + +# Check whether --with-pybuild_flags was given. +if test ${with_pybuild_flags+y} +then : + withval=$with_pybuild_flags; +fi + +PYBUILDFLAGS=$with_pybuild_flags + + + +# Check whether --with-pyinstall_flags was given. +if test ${with_pyinstall_flags+y} +then : + withval=$with_pyinstall_flags; +fi + +PYINSTALLFLAGS=$with_pyinstall_flags + + +# +# Docker +# + + + + + + + + + + + + if test -z "$DOCKER" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether docker executable path has been provided" >&5 +printf %s "checking whether docker executable path has been provided... " >&6; } + +# Check whether --with-docker was given. +if test ${with_docker+y} +then : + withval=$with_docker; + if test "$withval" != yes && test "$withval" != no +then : + + DOCKER="$withval" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DOCKER" >&5 +printf "%s\n" "$DOCKER" >&6; } + +else $as_nop + + DOCKER="" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + if test "$withval" != no +then : + + # Extract the first word of "docker", so it can be a program name with args. +set dummy docker; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_DOCKER+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $DOCKER in + [\\/]* | ?:[\\/]*) + ac_cv_path_DOCKER="$DOCKER" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_DOCKER="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_DOCKER" && ac_cv_path_DOCKER="no" + ;; +esac +fi +DOCKER=$ac_cv_path_DOCKER +if test -n "$DOCKER"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DOCKER" >&5 +printf "%s\n" "$DOCKER" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + +fi + +fi + +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + # Extract the first word of "docker", so it can be a program name with args. +set dummy docker; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_DOCKER+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $DOCKER in + [\\/]* | ?:[\\/]*) + ac_cv_path_DOCKER="$DOCKER" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_DOCKER="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_DOCKER" && ac_cv_path_DOCKER="no" + ;; +esac +fi +DOCKER=$ac_cv_path_DOCKER +if test -n "$DOCKER"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DOCKER" >&5 +printf "%s\n" "$DOCKER" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + +fi + + +fi + + + + + + +if test x${DOCKER} != xno +then : + HAVE_DOCKER=1 + +fi + +# +# Documentation +# + + + + + + + + + + + + +# Files: +DX_PROJECT=bifrost + +DX_CONFIG='$(srcdir)/Doxyfile' + +DX_DOCDIR='doxygen-doc' + + +# Environment variables used inside doxygen.cfg: +DX_ENV="$DX_ENV SRCDIR='$srcdir'" +SRCDIR=$srcdir + +DX_ENV="$DX_ENV PROJECT='$DX_PROJECT'" +PROJECT=$DX_PROJECT + +DX_ENV="$DX_ENV VERSION='$PACKAGE_VERSION'" + + +# Doxygen itself: + + + + # Check whether --enable-doxygen-doc was given. +if test ${enable_doxygen_doc+y} +then : + enableval=$enable_doxygen_doc; +case "$enableval" in +#( +y|Y|yes|Yes|YES) + DX_FLAG_doc=1 + + +;; #( +n|N|no|No|NO) + DX_FLAG_doc=0 + +;; #( +*) + as_fn_error $? "invalid value '$enableval' given to doxygen-doc" "$LINENO" 5 +;; +esac + +else $as_nop + +DX_FLAG_doc=1 + + + +fi + +if test "$DX_FLAG_doc" = 1; then + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}doxygen", so it can be a program name with args. +set dummy ${ac_tool_prefix}doxygen; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_DX_DOXYGEN+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $DX_DOXYGEN in + [\\/]* | ?:[\\/]*) + ac_cv_path_DX_DOXYGEN="$DX_DOXYGEN" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_DX_DOXYGEN="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +DX_DOXYGEN=$ac_cv_path_DX_DOXYGEN +if test -n "$DX_DOXYGEN"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DX_DOXYGEN" >&5 +printf "%s\n" "$DX_DOXYGEN" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_path_DX_DOXYGEN"; then + ac_pt_DX_DOXYGEN=$DX_DOXYGEN + # Extract the first word of "doxygen", so it can be a program name with args. +set dummy doxygen; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_DX_DOXYGEN+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $ac_pt_DX_DOXYGEN in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_DX_DOXYGEN="$ac_pt_DX_DOXYGEN" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_DX_DOXYGEN="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +ac_pt_DX_DOXYGEN=$ac_cv_path_ac_pt_DX_DOXYGEN +if test -n "$ac_pt_DX_DOXYGEN"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_DOXYGEN" >&5 +printf "%s\n" "$ac_pt_DX_DOXYGEN" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_pt_DX_DOXYGEN" = x; then + DX_DOXYGEN="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DX_DOXYGEN=$ac_pt_DX_DOXYGEN + fi +else + DX_DOXYGEN="$ac_cv_path_DX_DOXYGEN" +fi + +if test "$DX_FLAG_doc$DX_DOXYGEN" = 1; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: doxygen not found - will not generate any doxygen documentation" >&5 +printf "%s\n" "$as_me: WARNING: doxygen not found - will not generate any doxygen documentation" >&2;} + DX_FLAG_doc=0 + +fi + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}perl", so it can be a program name with args. +set dummy ${ac_tool_prefix}perl; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_DX_PERL+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $DX_PERL in + [\\/]* | ?:[\\/]*) + ac_cv_path_DX_PERL="$DX_PERL" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_DX_PERL="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +DX_PERL=$ac_cv_path_DX_PERL +if test -n "$DX_PERL"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DX_PERL" >&5 +printf "%s\n" "$DX_PERL" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_path_DX_PERL"; then + ac_pt_DX_PERL=$DX_PERL + # Extract the first word of "perl", so it can be a program name with args. +set dummy perl; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_DX_PERL+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $ac_pt_DX_PERL in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_DX_PERL="$ac_pt_DX_PERL" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_DX_PERL="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +ac_pt_DX_PERL=$ac_cv_path_ac_pt_DX_PERL +if test -n "$ac_pt_DX_PERL"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_PERL" >&5 +printf "%s\n" "$ac_pt_DX_PERL" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_pt_DX_PERL" = x; then + DX_PERL="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DX_PERL=$ac_pt_DX_PERL + fi +else + DX_PERL="$ac_cv_path_DX_PERL" +fi + +if test "$DX_FLAG_doc$DX_PERL" = 1; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: perl not found - will not generate any doxygen documentation" >&5 +printf "%s\n" "$as_me: WARNING: perl not found - will not generate any doxygen documentation" >&2;} + DX_FLAG_doc=0 + +fi + + : +fi +if test "$DX_FLAG_doc" = 1; then + DX_ENV="$DX_ENV PERL_PATH='$DX_PERL'" +PERL_PATH=$DX_PERL + + : +else + + : +fi + + +# Dot for graphics: + + + + # Check whether --enable-doxygen-dot was given. +if test ${enable_doxygen_dot+y} +then : + enableval=$enable_doxygen_dot; +case "$enableval" in +#( +y|Y|yes|Yes|YES) + DX_FLAG_dot=1 + + +test "$DX_FLAG_doc" = "1" \ +|| as_fn_error $? "doxygen-dot requires doxygen-doc" "$LINENO" 5 + +;; #( +n|N|no|No|NO) + DX_FLAG_dot=0 + +;; #( +*) + as_fn_error $? "invalid value '$enableval' given to doxygen-dot" "$LINENO" 5 +;; +esac + +else $as_nop + +DX_FLAG_dot=0 + + +test "$DX_FLAG_doc" = "1" || DX_FLAG_dot=0 + + + +fi + +if test "$DX_FLAG_dot" = 1; then + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dot", so it can be a program name with args. +set dummy ${ac_tool_prefix}dot; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_DX_DOT+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $DX_DOT in + [\\/]* | ?:[\\/]*) + ac_cv_path_DX_DOT="$DX_DOT" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_DX_DOT="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +DX_DOT=$ac_cv_path_DX_DOT +if test -n "$DX_DOT"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DX_DOT" >&5 +printf "%s\n" "$DX_DOT" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_path_DX_DOT"; then + ac_pt_DX_DOT=$DX_DOT + # Extract the first word of "dot", so it can be a program name with args. +set dummy dot; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_DX_DOT+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $ac_pt_DX_DOT in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_DX_DOT="$ac_pt_DX_DOT" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_DX_DOT="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +ac_pt_DX_DOT=$ac_cv_path_ac_pt_DX_DOT +if test -n "$ac_pt_DX_DOT"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_DOT" >&5 +printf "%s\n" "$ac_pt_DX_DOT" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_pt_DX_DOT" = x; then + DX_DOT="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DX_DOT=$ac_pt_DX_DOT + fi +else + DX_DOT="$ac_cv_path_DX_DOT" +fi + +if test "$DX_FLAG_dot$DX_DOT" = 1; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: dot not found - will not generate graphics for doxygen documentation" >&5 +printf "%s\n" "$as_me: WARNING: dot not found - will not generate graphics for doxygen documentation" >&2;} + DX_FLAG_dot=0 + +fi + + : +fi +if test "$DX_FLAG_dot" = 1; then + DX_ENV="$DX_ENV HAVE_DOT='YES'" +HAVE_DOT=YES + + DX_ENV="$DX_ENV DOT_PATH='`expr ".$DX_DOT" : '\(\.\)[^/]*$' \| "x$DX_DOT" : 'x\(.*\)/[^/]*$'`'" +DOT_PATH=`expr ".$DX_DOT" : '\(\.\)[^/]*$' \| "x$DX_DOT" : 'x\(.*\)/[^/]*$'` + + : +else + DX_ENV="$DX_ENV HAVE_DOT='NO'" +HAVE_DOT=NO + + : +fi + + +# Man pages generation: + + + + # Check whether --enable-doxygen-man was given. +if test ${enable_doxygen_man+y} +then : + enableval=$enable_doxygen_man; +case "$enableval" in +#( +y|Y|yes|Yes|YES) + DX_FLAG_man=1 + + +test "$DX_FLAG_doc" = "1" \ +|| as_fn_error $? "doxygen-man requires doxygen-doc" "$LINENO" 5 + +;; #( +n|N|no|No|NO) + DX_FLAG_man=0 + +;; #( +*) + as_fn_error $? "invalid value '$enableval' given to doxygen-man" "$LINENO" 5 +;; +esac + +else $as_nop + +DX_FLAG_man=1 + + +test "$DX_FLAG_doc" = "1" || DX_FLAG_man=0 + + + +fi + +if test "$DX_FLAG_man" = 1; then + + : +fi +if test "$DX_FLAG_man" = 1; then + DX_ENV="$DX_ENV GENERATE_MAN='YES'" +GENERATE_MAN=YES + + : +else + DX_ENV="$DX_ENV GENERATE_MAN='NO'" +GENERATE_MAN=NO + + : +fi + + +# RTF file generation: + + + + # Check whether --enable-doxygen-rtf was given. +if test ${enable_doxygen_rtf+y} +then : + enableval=$enable_doxygen_rtf; +case "$enableval" in +#( +y|Y|yes|Yes|YES) + DX_FLAG_rtf=1 + + +test "$DX_FLAG_doc" = "1" \ +|| as_fn_error $? "doxygen-rtf requires doxygen-doc" "$LINENO" 5 + +;; #( +n|N|no|No|NO) + DX_FLAG_rtf=0 + +;; #( +*) + as_fn_error $? "invalid value '$enableval' given to doxygen-rtf" "$LINENO" 5 +;; +esac + +else $as_nop + +DX_FLAG_rtf=0 + + +test "$DX_FLAG_doc" = "1" || DX_FLAG_rtf=0 + + + +fi + +if test "$DX_FLAG_rtf" = 1; then + + : +fi +if test "$DX_FLAG_rtf" = 1; then + DX_ENV="$DX_ENV GENERATE_RTF='YES'" +GENERATE_RTF=YES + + : +else + DX_ENV="$DX_ENV GENERATE_RTF='NO'" +GENERATE_RTF=NO + + : +fi + + +# XML file generation: + + + + # Check whether --enable-doxygen-xml was given. +if test ${enable_doxygen_xml+y} +then : + enableval=$enable_doxygen_xml; +case "$enableval" in +#( +y|Y|yes|Yes|YES) + DX_FLAG_xml=1 + + +test "$DX_FLAG_doc" = "1" \ +|| as_fn_error $? "doxygen-xml requires doxygen-doc" "$LINENO" 5 + +;; #( +n|N|no|No|NO) + DX_FLAG_xml=0 + +;; #( +*) + as_fn_error $? "invalid value '$enableval' given to doxygen-xml" "$LINENO" 5 +;; +esac + +else $as_nop + +DX_FLAG_xml=0 + + +test "$DX_FLAG_doc" = "1" || DX_FLAG_xml=0 + + + +fi + +if test "$DX_FLAG_xml" = 1; then + + : +fi +if test "$DX_FLAG_xml" = 1; then + DX_ENV="$DX_ENV GENERATE_XML='YES'" +GENERATE_XML=YES + + : +else + DX_ENV="$DX_ENV GENERATE_XML='NO'" +GENERATE_XML=NO + + : +fi + + +# (Compressed) HTML help generation: + + + + # Check whether --enable-doxygen-chm was given. +if test ${enable_doxygen_chm+y} +then : + enableval=$enable_doxygen_chm; +case "$enableval" in +#( +y|Y|yes|Yes|YES) + DX_FLAG_chm=1 + + +test "$DX_FLAG_doc" = "1" \ +|| as_fn_error $? "doxygen-chm requires doxygen-doc" "$LINENO" 5 + +;; #( +n|N|no|No|NO) + DX_FLAG_chm=0 + +;; #( +*) + as_fn_error $? "invalid value '$enableval' given to doxygen-chm" "$LINENO" 5 +;; +esac + +else $as_nop + +DX_FLAG_chm=0 + + +test "$DX_FLAG_doc" = "1" || DX_FLAG_chm=0 + + + +fi + +if test "$DX_FLAG_chm" = 1; then + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}hhc", so it can be a program name with args. +set dummy ${ac_tool_prefix}hhc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_DX_HHC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $DX_HHC in + [\\/]* | ?:[\\/]*) + ac_cv_path_DX_HHC="$DX_HHC" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_DX_HHC="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +DX_HHC=$ac_cv_path_DX_HHC +if test -n "$DX_HHC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DX_HHC" >&5 +printf "%s\n" "$DX_HHC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_path_DX_HHC"; then + ac_pt_DX_HHC=$DX_HHC + # Extract the first word of "hhc", so it can be a program name with args. +set dummy hhc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_DX_HHC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $ac_pt_DX_HHC in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_DX_HHC="$ac_pt_DX_HHC" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_DX_HHC="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +ac_pt_DX_HHC=$ac_cv_path_ac_pt_DX_HHC +if test -n "$ac_pt_DX_HHC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_HHC" >&5 +printf "%s\n" "$ac_pt_DX_HHC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_pt_DX_HHC" = x; then + DX_HHC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DX_HHC=$ac_pt_DX_HHC + fi +else + DX_HHC="$ac_cv_path_DX_HHC" +fi + +if test "$DX_FLAG_chm$DX_HHC" = 1; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: hhc not found - will not generate doxygen compressed HTML help documentation" >&5 +printf "%s\n" "$as_me: WARNING: hhc not found - will not generate doxygen compressed HTML help documentation" >&2;} + DX_FLAG_chm=0 + +fi + + : +fi +if test "$DX_FLAG_chm" = 1; then + DX_ENV="$DX_ENV HHC_PATH='$DX_HHC'" +HHC_PATH=$DX_HHC + + DX_ENV="$DX_ENV GENERATE_HTML='YES'" +GENERATE_HTML=YES + + DX_ENV="$DX_ENV GENERATE_HTMLHELP='YES'" +GENERATE_HTMLHELP=YES + + : +else + DX_ENV="$DX_ENV GENERATE_HTMLHELP='NO'" +GENERATE_HTMLHELP=NO + + : +fi + + +# Separate CHI file generation. + + + + # Check whether --enable-doxygen-chi was given. +if test ${enable_doxygen_chi+y} +then : + enableval=$enable_doxygen_chi; +case "$enableval" in +#( +y|Y|yes|Yes|YES) + DX_FLAG_chi=1 + + +test "$DX_FLAG_chm" = "1" \ +|| as_fn_error $? "doxygen-chi requires doxygen-chm" "$LINENO" 5 + +;; #( +n|N|no|No|NO) + DX_FLAG_chi=0 + +;; #( +*) + as_fn_error $? "invalid value '$enableval' given to doxygen-chi" "$LINENO" 5 +;; +esac + +else $as_nop + +DX_FLAG_chi=0 + + +test "$DX_FLAG_chm" = "1" || DX_FLAG_chi=0 + + + +fi + +if test "$DX_FLAG_chi" = 1; then + + : +fi +if test "$DX_FLAG_chi" = 1; then + DX_ENV="$DX_ENV GENERATE_CHI='YES'" +GENERATE_CHI=YES + + : +else + DX_ENV="$DX_ENV GENERATE_CHI='NO'" +GENERATE_CHI=NO + + : +fi + + +# Plain HTML pages generation: + + + + # Check whether --enable-doxygen-html was given. +if test ${enable_doxygen_html+y} +then : + enableval=$enable_doxygen_html; +case "$enableval" in +#( +y|Y|yes|Yes|YES) + DX_FLAG_html=1 + + +test "$DX_FLAG_doc" = "1" \ +|| as_fn_error $? "doxygen-html requires doxygen-doc" "$LINENO" 5 + +test "$DX_FLAG_chm" = "0" \ +|| as_fn_error $? "doxygen-html contradicts doxygen-chm" "$LINENO" 5 + +;; #( +n|N|no|No|NO) + DX_FLAG_html=0 + +;; #( +*) + as_fn_error $? "invalid value '$enableval' given to doxygen-html" "$LINENO" 5 +;; +esac + +else $as_nop + +DX_FLAG_html=1 + + +test "$DX_FLAG_doc" = "1" || DX_FLAG_html=0 + + +test "$DX_FLAG_chm" = "0" || DX_FLAG_html=0 + + + +fi + +if test "$DX_FLAG_html" = 1; then + + : +fi +if test "$DX_FLAG_html" = 1; then + DX_ENV="$DX_ENV GENERATE_HTML='YES'" +GENERATE_HTML=YES + + : +else + test "$DX_FLAG_chm" = 1 || DX_ENV="$DX_ENV GENERATE_HTML='NO'" +GENERATE_HTML=NO + + : +fi + + +# PostScript file generation: + + + + # Check whether --enable-doxygen-ps was given. +if test ${enable_doxygen_ps+y} +then : + enableval=$enable_doxygen_ps; +case "$enableval" in +#( +y|Y|yes|Yes|YES) + DX_FLAG_ps=1 + + +test "$DX_FLAG_doc" = "1" \ +|| as_fn_error $? "doxygen-ps requires doxygen-doc" "$LINENO" 5 + +;; #( +n|N|no|No|NO) + DX_FLAG_ps=0 + +;; #( +*) + as_fn_error $? "invalid value '$enableval' given to doxygen-ps" "$LINENO" 5 +;; +esac + +else $as_nop + +DX_FLAG_ps=1 + + +test "$DX_FLAG_doc" = "1" || DX_FLAG_ps=0 + + + +fi + +if test "$DX_FLAG_ps" = 1; then + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}latex", so it can be a program name with args. +set dummy ${ac_tool_prefix}latex; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_DX_LATEX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $DX_LATEX in + [\\/]* | ?:[\\/]*) + ac_cv_path_DX_LATEX="$DX_LATEX" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_DX_LATEX="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +DX_LATEX=$ac_cv_path_DX_LATEX +if test -n "$DX_LATEX"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DX_LATEX" >&5 +printf "%s\n" "$DX_LATEX" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_path_DX_LATEX"; then + ac_pt_DX_LATEX=$DX_LATEX + # Extract the first word of "latex", so it can be a program name with args. +set dummy latex; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_DX_LATEX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $ac_pt_DX_LATEX in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_DX_LATEX="$ac_pt_DX_LATEX" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_DX_LATEX="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +ac_pt_DX_LATEX=$ac_cv_path_ac_pt_DX_LATEX +if test -n "$ac_pt_DX_LATEX"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_LATEX" >&5 +printf "%s\n" "$ac_pt_DX_LATEX" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_pt_DX_LATEX" = x; then + DX_LATEX="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DX_LATEX=$ac_pt_DX_LATEX + fi +else + DX_LATEX="$ac_cv_path_DX_LATEX" +fi + +if test "$DX_FLAG_ps$DX_LATEX" = 1; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: latex not found - will not generate doxygen PostScript documentation" >&5 +printf "%s\n" "$as_me: WARNING: latex not found - will not generate doxygen PostScript documentation" >&2;} + DX_FLAG_ps=0 + +fi + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}makeindex", so it can be a program name with args. +set dummy ${ac_tool_prefix}makeindex; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_DX_MAKEINDEX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $DX_MAKEINDEX in + [\\/]* | ?:[\\/]*) + ac_cv_path_DX_MAKEINDEX="$DX_MAKEINDEX" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_DX_MAKEINDEX="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +DX_MAKEINDEX=$ac_cv_path_DX_MAKEINDEX +if test -n "$DX_MAKEINDEX"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DX_MAKEINDEX" >&5 +printf "%s\n" "$DX_MAKEINDEX" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_path_DX_MAKEINDEX"; then + ac_pt_DX_MAKEINDEX=$DX_MAKEINDEX + # Extract the first word of "makeindex", so it can be a program name with args. +set dummy makeindex; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_DX_MAKEINDEX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $ac_pt_DX_MAKEINDEX in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_DX_MAKEINDEX="$ac_pt_DX_MAKEINDEX" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_DX_MAKEINDEX="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +ac_pt_DX_MAKEINDEX=$ac_cv_path_ac_pt_DX_MAKEINDEX +if test -n "$ac_pt_DX_MAKEINDEX"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_MAKEINDEX" >&5 +printf "%s\n" "$ac_pt_DX_MAKEINDEX" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_pt_DX_MAKEINDEX" = x; then + DX_MAKEINDEX="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DX_MAKEINDEX=$ac_pt_DX_MAKEINDEX + fi +else + DX_MAKEINDEX="$ac_cv_path_DX_MAKEINDEX" +fi + +if test "$DX_FLAG_ps$DX_MAKEINDEX" = 1; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: makeindex not found - will not generate doxygen PostScript documentation" >&5 +printf "%s\n" "$as_me: WARNING: makeindex not found - will not generate doxygen PostScript documentation" >&2;} + DX_FLAG_ps=0 + +fi + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dvips", so it can be a program name with args. +set dummy ${ac_tool_prefix}dvips; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_DX_DVIPS+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $DX_DVIPS in + [\\/]* | ?:[\\/]*) + ac_cv_path_DX_DVIPS="$DX_DVIPS" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_DX_DVIPS="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +DX_DVIPS=$ac_cv_path_DX_DVIPS +if test -n "$DX_DVIPS"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DX_DVIPS" >&5 +printf "%s\n" "$DX_DVIPS" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_path_DX_DVIPS"; then + ac_pt_DX_DVIPS=$DX_DVIPS + # Extract the first word of "dvips", so it can be a program name with args. +set dummy dvips; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_DX_DVIPS+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $ac_pt_DX_DVIPS in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_DX_DVIPS="$ac_pt_DX_DVIPS" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_DX_DVIPS="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +ac_pt_DX_DVIPS=$ac_cv_path_ac_pt_DX_DVIPS +if test -n "$ac_pt_DX_DVIPS"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_DVIPS" >&5 +printf "%s\n" "$ac_pt_DX_DVIPS" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_pt_DX_DVIPS" = x; then + DX_DVIPS="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DX_DVIPS=$ac_pt_DX_DVIPS + fi +else + DX_DVIPS="$ac_cv_path_DX_DVIPS" +fi + +if test "$DX_FLAG_ps$DX_DVIPS" = 1; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: dvips not found - will not generate doxygen PostScript documentation" >&5 +printf "%s\n" "$as_me: WARNING: dvips not found - will not generate doxygen PostScript documentation" >&2;} + DX_FLAG_ps=0 + +fi + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}egrep", so it can be a program name with args. +set dummy ${ac_tool_prefix}egrep; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_DX_EGREP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $DX_EGREP in + [\\/]* | ?:[\\/]*) + ac_cv_path_DX_EGREP="$DX_EGREP" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_DX_EGREP="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +DX_EGREP=$ac_cv_path_DX_EGREP +if test -n "$DX_EGREP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DX_EGREP" >&5 +printf "%s\n" "$DX_EGREP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_path_DX_EGREP"; then + ac_pt_DX_EGREP=$DX_EGREP + # Extract the first word of "egrep", so it can be a program name with args. +set dummy egrep; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_DX_EGREP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $ac_pt_DX_EGREP in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_DX_EGREP="$ac_pt_DX_EGREP" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_DX_EGREP="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +ac_pt_DX_EGREP=$ac_cv_path_ac_pt_DX_EGREP +if test -n "$ac_pt_DX_EGREP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_EGREP" >&5 +printf "%s\n" "$ac_pt_DX_EGREP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_pt_DX_EGREP" = x; then + DX_EGREP="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DX_EGREP=$ac_pt_DX_EGREP + fi +else + DX_EGREP="$ac_cv_path_DX_EGREP" +fi + +if test "$DX_FLAG_ps$DX_EGREP" = 1; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: egrep not found - will not generate doxygen PostScript documentation" >&5 +printf "%s\n" "$as_me: WARNING: egrep not found - will not generate doxygen PostScript documentation" >&2;} + DX_FLAG_ps=0 + +fi + + : +fi +if test "$DX_FLAG_ps" = 1; then + + : +else + + : +fi + + +# PDF file generation: + + + + # Check whether --enable-doxygen-pdf was given. +if test ${enable_doxygen_pdf+y} +then : + enableval=$enable_doxygen_pdf; +case "$enableval" in +#( +y|Y|yes|Yes|YES) + DX_FLAG_pdf=1 + + +test "$DX_FLAG_doc" = "1" \ +|| as_fn_error $? "doxygen-pdf requires doxygen-doc" "$LINENO" 5 + +;; #( +n|N|no|No|NO) + DX_FLAG_pdf=0 + +;; #( +*) + as_fn_error $? "invalid value '$enableval' given to doxygen-pdf" "$LINENO" 5 +;; +esac + +else $as_nop + +DX_FLAG_pdf=1 + + +test "$DX_FLAG_doc" = "1" || DX_FLAG_pdf=0 + + + +fi + +if test "$DX_FLAG_pdf" = 1; then + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pdflatex", so it can be a program name with args. +set dummy ${ac_tool_prefix}pdflatex; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_DX_PDFLATEX+y} +then : + printf %s "(cached) " >&6 else $as_nop - with_shared_mem=16384 + case $DX_PDFLATEX in + [\\/]* | ?:[\\/]*) + ac_cv_path_DX_PDFLATEX="$DX_PDFLATEX" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_DX_PDFLATEX="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +DX_PDFLATEX=$ac_cv_path_DX_PDFLATEX +if test -n "$DX_PDFLATEX"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DX_PDFLATEX" >&5 +printf "%s\n" "$DX_PDFLATEX" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_path_DX_PDFLATEX"; then + ac_pt_DX_PDFLATEX=$DX_PDFLATEX + # Extract the first word of "pdflatex", so it can be a program name with args. +set dummy pdflatex; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_DX_PDFLATEX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $ac_pt_DX_PDFLATEX in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_DX_PDFLATEX="$ac_pt_DX_PDFLATEX" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_DX_PDFLATEX="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +ac_pt_DX_PDFLATEX=$ac_cv_path_ac_pt_DX_PDFLATEX +if test -n "$ac_pt_DX_PDFLATEX"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_PDFLATEX" >&5 +printf "%s\n" "$ac_pt_DX_PDFLATEX" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_pt_DX_PDFLATEX" = x; then + DX_PDFLATEX="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DX_PDFLATEX=$ac_pt_DX_PDFLATEX + fi +else + DX_PDFLATEX="$ac_cv_path_DX_PDFLATEX" +fi + +if test "$DX_FLAG_pdf$DX_PDFLATEX" = 1; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: pdflatex not found - will not generate doxygen PDF documentation" >&5 +printf "%s\n" "$as_me: WARNING: pdflatex not found - will not generate doxygen PDF documentation" >&2;} + DX_FLAG_pdf=0 + +fi + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}makeindex", so it can be a program name with args. +set dummy ${ac_tool_prefix}makeindex; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_DX_MAKEINDEX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $DX_MAKEINDEX in + [\\/]* | ?:[\\/]*) + ac_cv_path_DX_MAKEINDEX="$DX_MAKEINDEX" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_DX_MAKEINDEX="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +DX_MAKEINDEX=$ac_cv_path_DX_MAKEINDEX +if test -n "$DX_MAKEINDEX"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DX_MAKEINDEX" >&5 +printf "%s\n" "$DX_MAKEINDEX" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_path_DX_MAKEINDEX"; then + ac_pt_DX_MAKEINDEX=$DX_MAKEINDEX + # Extract the first word of "makeindex", so it can be a program name with args. +set dummy makeindex; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_DX_MAKEINDEX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $ac_pt_DX_MAKEINDEX in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_DX_MAKEINDEX="$ac_pt_DX_MAKEINDEX" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_DX_MAKEINDEX="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +ac_pt_DX_MAKEINDEX=$ac_cv_path_ac_pt_DX_MAKEINDEX +if test -n "$ac_pt_DX_MAKEINDEX"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_MAKEINDEX" >&5 +printf "%s\n" "$ac_pt_DX_MAKEINDEX" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_pt_DX_MAKEINDEX" = x; then + DX_MAKEINDEX="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DX_MAKEINDEX=$ac_pt_DX_MAKEINDEX + fi +else + DX_MAKEINDEX="$ac_cv_path_DX_MAKEINDEX" +fi + +if test "$DX_FLAG_pdf$DX_MAKEINDEX" = 1; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: makeindex not found - will not generate doxygen PDF documentation" >&5 +printf "%s\n" "$as_me: WARNING: makeindex not found - will not generate doxygen PDF documentation" >&2;} + DX_FLAG_pdf=0 + +fi + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}egrep", so it can be a program name with args. +set dummy ${ac_tool_prefix}egrep; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_DX_EGREP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $DX_EGREP in + [\\/]* | ?:[\\/]*) + ac_cv_path_DX_EGREP="$DX_EGREP" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_DX_EGREP="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +DX_EGREP=$ac_cv_path_DX_EGREP +if test -n "$DX_EGREP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DX_EGREP" >&5 +printf "%s\n" "$DX_EGREP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_path_DX_EGREP"; then + ac_pt_DX_EGREP=$DX_EGREP + # Extract the first word of "egrep", so it can be a program name with args. +set dummy egrep; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_DX_EGREP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $ac_pt_DX_EGREP in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_DX_EGREP="$ac_pt_DX_EGREP" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_DX_EGREP="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +ac_pt_DX_EGREP=$ac_cv_path_ac_pt_DX_EGREP +if test -n "$ac_pt_DX_EGREP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_EGREP" >&5 +printf "%s\n" "$ac_pt_DX_EGREP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_pt_DX_EGREP" = x; then + DX_EGREP="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DX_EGREP=$ac_pt_DX_EGREP + fi +else + DX_EGREP="$ac_cv_path_DX_EGREP" fi -GPU_SHAREDMEM=$with_shared_mem - -if test x$HAVE_CUDA = x0 -then : - GPU_SHAREDMEM=0 +if test "$DX_FLAG_pdf$DX_EGREP" = 1; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: egrep not found - will not generate doxygen PDF documentation" >&5 +printf "%s\n" "$as_me: WARNING: egrep not found - will not generate doxygen PDF documentation" >&2;} + DX_FLAG_pdf=0 fi -# -# Bifrost memory alignment -# + : +fi +if test "$DX_FLAG_pdf" = 1; then + : +else -# Check whether --with-alignment was given. -if test ${with_alignment+y} -then : - withval=$with_alignment; -else $as_nop - with_alignment=4096 + : fi -ALIGNMENT=$with_alignment - -# -# Bifrost proclog location -# +# LaTeX generation for PS and/or PDF: +if test "$DX_FLAG_ps" = 1 || test "$DX_FLAG_pdf" = 1; then + DX_ENV="$DX_ENV GENERATE_LATEX='YES'" +GENERATE_LATEX=YES +else + DX_ENV="$DX_ENV GENERATE_LATEX='NO'" +GENERATE_LATEX=NO +fi +# Paper size for PS and/or PDF: +case "$DOXYGEN_PAPER_SIZE" in +#( +"") + DOXYGEN_PAPER_SIZE="" -# Check whether --with-logging_dir was given. -if test ${with_logging_dir+y} -then : - withval=$with_logging_dir; HAVE_TMPFS=$with_logging_dir +;; #( +a4wide|a4|letter|legal|executive) + DX_ENV="$DX_ENV PAPER_SIZE='$DOXYGEN_PAPER_SIZE'" +PAPER_SIZE=$DOXYGEN_PAPER_SIZE -else $as_nop - HAVE_TMPFS=/tmp +;; #( +*) + as_fn_error $? "unknown DOXYGEN_PAPER_SIZE='$DOXYGEN_PAPER_SIZE'" "$LINENO" 5 +;; +esac -fi +# Rules: +if test $DX_FLAG_html -eq 1 +then : + DX_SNIPPET_html="## ------------------------------- ## +## Rules specific for HTML output. ## +## ------------------------------- ## +DX_CLEAN_HTML = \$(DX_DOCDIR)/html\\ + \$(DX_DOCDIR)/html - if test "$HAVE_TMPFS" = "/tmp"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for /dev/shm" >&5 -printf %s "checking for /dev/shm... " >&6; } -if test ${ac_cv_file__dev_shm+y} -then : - printf %s "(cached) " >&6 +" else $as_nop - test "$cross_compiling" = yes && - as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 -if test -r "/dev/shm"; then - ac_cv_file__dev_shm=yes -else - ac_cv_file__dev_shm=no -fi -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__dev_shm" >&5 -printf "%s\n" "$ac_cv_file__dev_shm" >&6; } -if test "x$ac_cv_file__dev_shm" = xyes -then : - HAVE_TMPFS=/dev/shm/bifrost - + DX_SNIPPET_html="" fi - - fi - - if test "$HAVE_TMPFS" = "/tmp"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for /Volumes/RAMDisk" >&5 -printf %s "checking for /Volumes/RAMDisk... " >&6; } -if test ${ac_cv_file__Volumes_RAMDisk+y} +if test $DX_FLAG_chi -eq 1 then : - printf %s "(cached) " >&6 + DX_SNIPPET_chi=" +DX_CLEAN_CHI = \$(DX_DOCDIR)/\$(PACKAGE).chi\\ + \$(DX_DOCDIR)/\$(PACKAGE).chi" else $as_nop - test "$cross_compiling" = yes && - as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 -if test -r "/Volumes/RAMDisk"; then - ac_cv_file__Volumes_RAMDisk=yes -else - ac_cv_file__Volumes_RAMDisk=no + DX_SNIPPET_chi="" fi -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__Volumes_RAMDisk" >&5 -printf "%s\n" "$ac_cv_file__Volumes_RAMDisk" >&6; } -if test "x$ac_cv_file__Volumes_RAMDisk" = xyes +if test $DX_FLAG_chm -eq 1 then : - HAVE_TMPFS=/Volumes/RAMDisk/bifrost - -fi + DX_SNIPPET_chm="## ------------------------------ ## +## Rules specific for CHM output. ## +## ------------------------------ ## - fi +DX_CLEAN_CHM = \$(DX_DOCDIR)/chm\\ + \$(DX_DOCDIR)/chm\ +${DX_SNIPPET_chi} - if test "$HAVE_TMPFS" = "/tmp"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for /tmp" >&5 -printf %s "checking for /tmp... " >&6; } -if test ${ac_cv_file__tmp+y} -then : - printf %s "(cached) " >&6 +" else $as_nop - test "$cross_compiling" = yes && - as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 -if test -r "/tmp"; then - ac_cv_file__tmp=yes -else - ac_cv_file__tmp=no -fi + DX_SNIPPET_chm="" fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__tmp" >&5 -printf "%s\n" "$ac_cv_file__tmp" >&6; } -if test "x$ac_cv_file__tmp" = xyes +if test $DX_FLAG_man -eq 1 then : - HAVE_TMPFS=/tmp - -fi - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $HAVE_TMPFS may have performance problems for logging" >&5 -printf "%s\n" "$as_me: WARNING: $HAVE_TMPFS may have performance problems for logging" >&2;} - HAVE_TMPFS=/tmp/bifrost + DX_SNIPPET_man="## ------------------------------ ## +## Rules specific for MAN output. ## +## ------------------------------ ## - fi - - -# -# Bifrost Features -# +DX_CLEAN_MAN = \$(DX_DOCDIR)/man\\ + \$(DX_DOCDIR)/man -# Check whether --enable-debug was given. -if test ${enable_debug+y} -then : - enableval=$enable_debug; enable_debug=yes +" else $as_nop - enable_debug=no + DX_SNIPPET_man="" fi - -HAVE_DEBUG=0 - -if test x$enable_debug != xno +if test $DX_FLAG_rtf -eq 1 then : - HAVE_DEBUG=1 + DX_SNIPPET_rtf="## ------------------------------ ## +## Rules specific for RTF output. ## +## ------------------------------ ## - CXXFLAGS="$CXXFLAGS -g" - NVCCFLAGS="$NVCCFLAGS -g" -fi +DX_CLEAN_RTF = \$(DX_DOCDIR)/rtf\\ + \$(DX_DOCDIR)/rtf -# Check whether --enable-trace was given. -if test ${enable_trace+y} -then : - enableval=$enable_trace; enable_trace=yes +" else $as_nop - enable_trace=no + DX_SNIPPET_rtf="" fi - -HAVE_TRACE=0 - -if test x$enable_trace != xno +if test $DX_FLAG_xml -eq 1 then : - HAVE_TRACE=1 - -fi - + DX_SNIPPET_xml="## ------------------------------ ## +## Rules specific for XML output. ## +## ------------------------------ ## +DX_CLEAN_XML = \$(DX_DOCDIR)/xml\\ + \$(DX_DOCDIR)/xml - # Check whether --enable-native_arch was given. -if test ${enable_native_arch+y} -then : - enableval=$enable_native_arch; enable_native_arch=no +" else $as_nop - enable_native_arch=yes + DX_SNIPPET_xml="" fi +if test $DX_FLAG_ps -eq 1 +then : + DX_SNIPPET_ps="## ----------------------------- ## +## Rules specific for PS output. ## +## ----------------------------- ## +DX_CLEAN_PS = \$(DX_DOCDIR)/\$(PACKAGE).ps\\ + \$(DX_DOCDIR)/\$(PACKAGE).ps - if test "$enable_native_arch" = "yes"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the compiler accepts '-march=native'" >&5 -printf %s "checking if the compiler accepts '-march=native'... " >&6; } - - CXXFLAGS_temp="$CXXFLAGS -march=native" - - ac_compile='$CXX -c $CXXFLAGS_temp conftest.$ac_ext >&5' - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - +DX_PS_GOAL = doxygen-ps +doxygen-ps: \$(DX_CLEAN_PS) -int -main (void) -{ +\$(DX_DOCDIR)/\$(PACKAGE).ps: \$(DX_DOCDIR)/\$(PACKAGE).tag + \$(DX_V_LATEX)cd \$(DX_DOCDIR)/latex; \\ + rm -f *.aux *.toc *.idx *.ind *.ilg *.log *.out; \\ + \$(DX_LATEX) refman.tex; \\ + \$(DX_MAKEINDEX) refman.idx; \\ + \$(DX_LATEX) refman.tex; \\ + countdown=5; \\ + while \$(DX_EGREP) 'Rerun (LaTeX|to get cross-references right)' \\ + refman.log > /dev/null 2>&1 \\ + && test \$\$countdown -gt 0; do \\ + \$(DX_LATEX) refman.tex; \\ + countdown=\`expr \$\$countdown - 1\`; \\ + done; \\ + \$(DX_DVIPS) -o ../\$(PACKAGE).ps refman.dvi - int i = 5; - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : - CXXFLAGS="$CXXFLAGS -march=native" - NVCCFLAGS="$NVCCFLAGS -Xcompiler \"-march=native\"" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } +" else $as_nop - enable_native_arch=no - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + DX_SNIPPET_ps="" fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - fi - - -# Check whether --enable-cuda_debug was given. -if test ${enable_cuda_debug+y} +if test $DX_FLAG_pdf -eq 1 then : - enableval=$enable_cuda_debug; enable_cuda_debug=yes -else $as_nop - enable_cuda_debug=no -fi + DX_SNIPPET_pdf="## ------------------------------ ## +## Rules specific for PDF output. ## +## ------------------------------ ## -HAVE_CUDA_DEBUG=0 - -if test x$enable_cuda_debug != xno -then : - HAVE_CUDA_DEBUG=1 +DX_CLEAN_PDF = \$(DX_DOCDIR)/\$(PACKAGE).pdf\\ + \$(DX_DOCDIR)/\$(PACKAGE).pdf - NVCCFLAGS="$NVCCFLAGS -G" -fi +DX_PDF_GOAL = doxygen-pdf +doxygen-pdf: \$(DX_CLEAN_PDF) +\$(DX_DOCDIR)/\$(PACKAGE).pdf: \$(DX_DOCDIR)/\$(PACKAGE).tag + \$(DX_V_LATEX)cd \$(DX_DOCDIR)/latex; \\ + rm -f *.aux *.toc *.idx *.ind *.ilg *.log *.out; \\ + \$(DX_PDFLATEX) refman.tex; \\ + \$(DX_MAKEINDEX) refman.idx; \\ + \$(DX_PDFLATEX) refman.tex; \\ + countdown=5; \\ + while \$(DX_EGREP) 'Rerun (LaTeX|to get cross-references right)' \\ + refman.log > /dev/null 2>&1 \\ + && test \$\$countdown -gt 0; do \\ + \$(DX_PDFLATEX) refman.tex; \\ + countdown=\`expr \$\$countdown - 1\`; \\ + done; \\ + mv refman.pdf ../\$(PACKAGE).pdf -# Check whether --with-mapped_ring_dir was given. -if test ${with_mapped_ring_dir+y} -then : - withval=$with_mapped_ring_dir; +" else $as_nop - mapped_ring_dir=/tmp/bifrost_mapped + DX_SNIPPET_pdf="" fi - -MAPPED_RING_DIR=$mapped_ring_dir - - -# -# Python -# - -# Check whether --enable-python was given. -if test ${enable_python+y} +if test $DX_FLAG_ps -eq 1 -o $DX_FLAG_pdf -eq 1 then : - enableval=$enable_python; enable_python=no -else $as_nop - enable_python=yes -fi + DX_SNIPPET_latex="## ------------------------------------------------- ## +## Rules specific for LaTeX (shared for PS and PDF). ## +## ------------------------------------------------- ## -HAVE_PYTHON=0 +DX_V_LATEX = \$(_DX_v_LATEX_\$(V)) +_DX_v_LATEX_ = \$(_DX_v_LATEX_\$(AM_DEFAULT_VERBOSITY)) +_DX_v_LATEX_0 = @echo \" LATEX \" \$@; -if test x$enable_python != xno -then : - AX_WITH_PROG(PYTHON, python, no, $PATH) - if test x${PYTHON} != xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $PYTHON as ctypesgen" >&5 -printf %s "checking whether $PYTHON as ctypesgen... " >&6; } - if ! ${PYTHON} -c "import ctypesgen" 2>/dev/null -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: python module will not be built" >&5 -printf "%s\n" "$as_me: WARNING: python module will not be built" >&2;} -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } - HAVE_PYTHON=1 +DX_CLEAN_LATEX = \$(DX_DOCDIR)/latex\\ + \$(DX_DOCDIR)/latex -fi -fi +" +else $as_nop + DX_SNIPPET_latex="" fi -# Check whether --with-pybuild_flags was given. -if test ${with_pybuild_flags+y} +if test $DX_FLAG_doc -eq 1 then : - withval=$with_pybuild_flags; -fi - -PYBUILDFLAGS=$with_pybuild_flags + DX_SNIPPET_doc="## --------------------------------- ## +## Format-independent Doxygen rules. ## +## --------------------------------- ## +${DX_SNIPPET_html}\ +${DX_SNIPPET_chm}\ +${DX_SNIPPET_man}\ +${DX_SNIPPET_rtf}\ +${DX_SNIPPET_xml}\ +${DX_SNIPPET_ps}\ +${DX_SNIPPET_pdf}\ +${DX_SNIPPET_latex}\ +DX_V_DXGEN = \$(_DX_v_DXGEN_\$(V)) +_DX_v_DXGEN_ = \$(_DX_v_DXGEN_\$(AM_DEFAULT_VERBOSITY)) +_DX_v_DXGEN_0 = @echo \" DXGEN \" \$<; +.PHONY: doxygen-run doxygen-doc \$(DX_PS_GOAL) \$(DX_PDF_GOAL) -# Check whether --with-pyinstall_flags was given. -if test ${with_pyinstall_flags+y} -then : - withval=$with_pyinstall_flags; -fi - -PYINSTALLFLAGS=$with_pyinstall_flags +.INTERMEDIATE: doxygen-run \$(DX_PS_GOAL) \$(DX_PDF_GOAL) +doxygen-run: \$(DX_DOCDIR)/\$(PACKAGE).tag -# -# Docker -# +doxygen-doc: doxygen-run \$(DX_PS_GOAL) \$(DX_PDF_GOAL) -AX_WITH_PROG(DOCKER, docker, no, $PATH) -if test x${DOCKER} != xno -then : - HAVE_DOCKER=1 +\$(DX_DOCDIR)/\$(PACKAGE).tag: \$(DX_CONFIG) \$(pkginclude_HEADERS) + \$(A""M_V_at)rm -rf \$(DX_DOCDIR) + \$(DX_V_DXGEN)\$(DX_ENV) DOCDIR=\$(DX_DOCDIR) \$(DX_DOXYGEN) \$(DX_CONFIG) + \$(A""M_V_at)echo Timestamp >\$@ +DX_CLEANFILES = \\ + \$(DX_DOCDIR)/doxygen_sqlite3.db \\ + \$(DX_DOCDIR)/\$(PACKAGE).tag \\ + -r \\ + \$(DX_CLEAN_HTML) \\ + \$(DX_CLEAN_CHM) \\ + \$(DX_CLEAN_CHI) \\ + \$(DX_CLEAN_MAN) \\ + \$(DX_CLEAN_RTF) \\ + \$(DX_CLEAN_XML) \\ + \$(DX_CLEAN_PS) \\ + \$(DX_CLEAN_PDF) \\ + \$(DX_CLEAN_LATEX)" +else $as_nop + DX_SNIPPET_doc="" fi +DX_RULES="${DX_SNIPPET_doc}" -# -# Documentation -# -DX_DOT_FEATURE(OFF) -DX_HTML_FEATURE(ON) -DX_CHM_FEATURE(OFF) -DX_CHI_FEATURE(OFF) -DX_MAN_FEATURE(ON) -DX_RTF_FEATURE(OFF) -DX_XML_FEATURE(OFF) -DX_PDF_FEATURE(ON) -DX_PS_FEATURE(ON) -DX_INIT_DOXYGEN(bifrost) +#For debugging: +#echo DX_FLAG_doc=$DX_FLAG_doc +#echo DX_FLAG_dot=$DX_FLAG_dot +#echo DX_FLAG_man=$DX_FLAG_man +#echo DX_FLAG_html=$DX_FLAG_html +#echo DX_FLAG_chm=$DX_FLAG_chm +#echo DX_FLAG_chi=$DX_FLAG_chi +#echo DX_FLAG_rtf=$DX_FLAG_rtf +#echo DX_FLAG_xml=$DX_FLAG_xml +#echo DX_FLAG_pdf=$DX_FLAG_pdf +#echo DX_FLAG_ps=$DX_FLAG_ps +#echo DX_ENV=$DX_ENV + # # Version splitting From 2ac8b05c023082c56ffc1d2027dd9a211fcd80d2 Mon Sep 17 00:00:00 2001 From: jaycedowell Date: Thu, 24 Mar 2022 18:08:52 -0600 Subject: [PATCH 38/48] Fix segfault under MacOS. --- src/memory.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/memory.cpp b/src/memory.cpp index abafb80c5..08d4810e8 100644 --- a/src/memory.cpp +++ b/src/memory.cpp @@ -120,8 +120,9 @@ class MappedMgr { make_dir(_mapped_dir); } ~MappedMgr() { - for(auto& x : _filenames) { - this->free(x.first); + while(! _filenames.empty() ) { + auto x = _filenames.begin(); + this->free(x->first); } try { remove_all(_mapped_dir); @@ -168,7 +169,7 @@ class MappedMgr { return 3; } - // Advise the kernel of how we'll use it + // Advise the kernel of how we'll use it ::madvise(*data, size, MADV_SEQUENTIAL); // Save and return From 5e6a6e87aed6317f8c5e2803f5cc73d52ec9ea00 Mon Sep 17 00:00:00 2001 From: jaycedowell Date: Thu, 24 Mar 2022 18:10:54 -0600 Subject: [PATCH 39/48] Formatting cleanup. --- src/memory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/memory.cpp b/src/memory.cpp index 08d4810e8..6b5eb2ca6 100644 --- a/src/memory.cpp +++ b/src/memory.cpp @@ -169,7 +169,7 @@ class MappedMgr { return 3; } - // Advise the kernel of how we'll use it + // Advise the kernel of how we'll use it ::madvise(*data, size, MADV_SEQUENTIAL); // Save and return From ed7ae5d36f0ddfa93c3f96e9cae3fc86292abb90 Mon Sep 17 00:00:00 2001 From: jaycedowell Date: Thu, 24 Mar 2022 18:30:29 -0600 Subject: [PATCH 40/48] Reorder to make MacOS happier. --- src/fileutils.hpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/fileutils.hpp b/src/fileutils.hpp index 68bd3887c..99a7f24f3 100644 --- a/src/fileutils.hpp +++ b/src/fileutils.hpp @@ -35,7 +35,7 @@ #include inline void make_dir(std::string path, int perms=775) { - if( std::system(("mkdir -p "+path+" -m "+std::to_string(perms)).c_str()) ) { + if( std::system(("mkdir -p -m "+std::to_string(perms)+" "+path).c_str()) ) { throw std::runtime_error("Failed to create path: "+path); } } @@ -96,4 +96,3 @@ class LockFile { flock(_fd, LOCK_UN); } }; - From 84b29ba421388bf766f4d706a450ec4496a08d0c Mon Sep 17 00:00:00 2001 From: jaycedowell Date: Fri, 25 Mar 2022 06:16:21 -0600 Subject: [PATCH 41/48] Style. --- src/memory.cpp | 36 ++++++++++++++++++------------------ src/ring_impl.cpp | 2 +- src/utils.hpp | 4 ++-- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/memory.cpp b/src/memory.cpp index 6b5eb2ca6..04998217b 100644 --- a/src/memory.cpp +++ b/src/memory.cpp @@ -52,7 +52,7 @@ static_assert(BF_IS_POW2(BF_ALIGNMENT), "BF_ALIGNMENT must be a power of 2"); #undef BF_IS_POW2 //static_assert(BF_ALIGNMENT >= 8, "BF_ALIGNMENT must be >= 8"); -#if defined __APPLE__ && __APPLE__ +#if defined(__APPLE__) && __APPLE__ // Based on information from: // https://hg.mozilla.org/mozilla-central/file/3d846420a907/xpcom/glue/FileUtils.cpp#l61 @@ -215,7 +215,7 @@ class MappedMgr { BFstatus bfGetSpace(const void* ptr, BFspace* space) { BF_ASSERT(ptr, BF_STATUS_INVALID_POINTER); -#if !defined BF_CUDA_ENABLED || !BF_CUDA_ENABLED +#if !defined(BF_CUDA_ENABLED) || !BF_CUDA_ENABLED if( MappedMgr::get().is_mapped((void*) ptr) ) { *space = BF_SPACE_MAPPED; } else { @@ -302,7 +302,7 @@ BFstatus bfMalloc(void** ptr, BFsize size, BFspace space) { BF_ASSERT(!err, BF_STATUS_MEM_ALLOC_FAILED); break; } -#if defined BF_CUDA_ENABLED && BF_CUDA_ENABLED +#if defined(BF_CUDA_ENABLED) && BF_CUDA_ENABLED case BF_SPACE_CUDA: { BF_CHECK_CUDA(cudaMalloc((void**)&data, size), BF_STATUS_MEM_ALLOC_FAILED); @@ -335,7 +335,7 @@ BFstatus bfFree(void* ptr, BFspace space) { switch( space ) { case BF_SPACE_SYSTEM: ::free(ptr); break; case BF_SPACE_MAPPED: MappedMgr::get().free(ptr); break; -#if defined BF_CUDA_ENABLED && BF_CUDA_ENABLED +#if defined(BF_CUDA_ENABLED) && BF_CUDA_ENABLED case BF_SPACE_CUDA: cudaFree(ptr); break; case BF_SPACE_CUDA_HOST: cudaFreeHost(ptr); break; case BF_SPACE_CUDA_MANAGED: cudaFree(ptr); break; @@ -356,22 +356,22 @@ BFstatus bfMemcpy(void* dst, // than using cudaMemcpyDefault. if( src_space == BF_SPACE_AUTO ) bfGetSpace(src, &src_space); if( dst_space == BF_SPACE_AUTO ) bfGetSpace(dst, &dst_space); -#if defined BF_CUDA_ENABLED && BF_CUDA_ENABLED +#if defined(BF_CUDA_ENABLED) && BF_CUDA_ENABLED cudaMemcpyKind kind = cudaMemcpyDefault; #endif switch( src_space ) { -#if defined BF_CUDA_ENABLED && BF_CUDA_ENABLED +#if defined(BF_CUDA_ENABLED) && BF_CUDA_ENABLED case BF_SPACE_CUDA_HOST: // fall-through #endif case BF_SPACE_MAPPED: // fall-through case BF_SPACE_SYSTEM: { switch( dst_space ) { -#if defined BF_CUDA_ENABLED && BF_CUDA_ENABLED +#if defined(BF_CUDA_ENABLED) && BF_CUDA_ENABLED case BF_SPACE_CUDA_HOST: // fall-through #endif case BF_SPACE_MAPPED: // fall-through case BF_SPACE_SYSTEM: ::memcpy(dst, src, count); return BF_STATUS_SUCCESS; -#if defined BF_CUDA_ENABLED && BF_CUDA_ENABLED +#if defined(BF_CUDA_ENABLED) && BF_CUDA_ENABLED case BF_SPACE_CUDA: kind = cudaMemcpyHostToDevice; break; // Is this the right thing to do? case BF_SPACE_CUDA_MANAGED: kind = cudaMemcpyDefault; break; @@ -380,7 +380,7 @@ BFstatus bfMemcpy(void* dst, } break; } -#if defined BF_CUDA_ENABLED && BF_CUDA_ENABLED +#if defined(BF_CUDA_ENABLED) && BF_CUDA_ENABLED case BF_SPACE_CUDA: { switch( dst_space ) { case BF_SPACE_CUDA_HOST: // fall-through @@ -397,7 +397,7 @@ BFstatus bfMemcpy(void* dst, #endif default: BF_FAIL("Valid bfMemcpy src space", BF_STATUS_INVALID_ARGUMENT); } -#if defined BF_CUDA_ENABLED && BF_CUDA_ENABLED +#if defined(BF_CUDA_ENABLED) && BF_CUDA_ENABLED BF_TRACE_STREAM(g_cuda_stream); BF_CHECK_CUDA(cudaMemcpyAsync(dst, src, count, kind, g_cuda_stream), BF_STATUS_MEM_OP_FAILED); @@ -435,22 +435,22 @@ BFstatus bfMemcpy2D(void* dst, // than using cudaMemcpyDefault. if( src_space == BF_SPACE_AUTO ) bfGetSpace(src, &src_space); if( dst_space == BF_SPACE_AUTO ) bfGetSpace(dst, &dst_space); -#if defined BF_CUDA_ENABLED && BF_CUDA_ENABLED +#if defined(BF_CUDA_ENABLED) && BF_CUDA_ENABLED cudaMemcpyKind kind = cudaMemcpyDefault; #endif switch( src_space ) { -#if defined BF_CUDA_ENABLED && BF_CUDA_ENABLED +#if defined(BF_CUDA_ENABLED) && BF_CUDA_ENABLED case BF_SPACE_CUDA_HOST: // fall-through #endif case BF_SPACE_MAPPED: // fall-through case BF_SPACE_SYSTEM: { switch( dst_space ) { -#if defined BF_CUDA_ENABLED && BF_CUDA_ENABLED +#if defined(BF_CUDA_ENABLED) && BF_CUDA_ENABLED case BF_SPACE_CUDA_HOST: // fall-through #endif case BF_SPACE_MAPPED: // fall-through case BF_SPACE_SYSTEM: memcpy2D(dst, dst_stride, src, src_stride, width, height); return BF_STATUS_SUCCESS; -#if defined BF_CUDA_ENABLED && BF_CUDA_ENABLED +#if defined(BF_CUDA_ENABLED) && BF_CUDA_ENABLED case BF_SPACE_CUDA: kind = cudaMemcpyHostToDevice; break; // TODO: Is this the right thing to do? case BF_SPACE_CUDA_MANAGED: kind = cudaMemcpyDefault; break; @@ -459,7 +459,7 @@ BFstatus bfMemcpy2D(void* dst, } break; } -#if defined BF_CUDA_ENABLED && BF_CUDA_ENABLED +#if defined(BF_CUDA_ENABLED) && BF_CUDA_ENABLED case BF_SPACE_CUDA: { switch( dst_space ) { case BF_SPACE_CUDA_HOST: // fall-through @@ -477,7 +477,7 @@ BFstatus bfMemcpy2D(void* dst, #endif default: BF_FAIL("Valid bfMemcpy2D src space", BF_STATUS_INVALID_ARGUMENT); } -#if defined BF_CUDA_ENABLED && BF_CUDA_ENABLED +#if defined(BF_CUDA_ENABLED) && BF_CUDA_ENABLED BF_TRACE_STREAM(g_cuda_stream); BF_CHECK_CUDA(cudaMemcpy2DAsync(dst, dst_stride, src, src_stride, @@ -501,7 +501,7 @@ BFstatus bfMemset(void* ptr, switch( space ) { case BF_SPACE_MAPPED: // fall-through case BF_SPACE_SYSTEM: ::memset(ptr, value, count); break; -#if defined BF_CUDA_ENABLED && BF_CUDA_ENABLED +#if defined(BF_CUDA_ENABLED) && BF_CUDA_ENABLED case BF_SPACE_CUDA_HOST: ::memset(ptr, value, count); break; case BF_SPACE_CUDA: // Fall-through case BF_SPACE_CUDA_MANAGED: { @@ -539,7 +539,7 @@ BFstatus bfMemset2D(void* ptr, switch( space ) { case BF_SPACE_MAPPED: // fall-through case BF_SPACE_SYSTEM: memset2D(ptr, stride, value, width, height); break; -#if defined BF_CUDA_ENABLED && BF_CUDA_ENABLED +#if defined(BF_CUDA_ENABLED) && BF_CUDA_ENABLED case BF_SPACE_CUDA_HOST: memset2D(ptr, stride, value, width, height); break; case BF_SPACE_CUDA: // fall-through case BF_SPACE_CUDA_MANAGED: { diff --git a/src/ring_impl.cpp b/src/ring_impl.cpp index 51e445b94..8d89c5e90 100644 --- a/src/ring_impl.cpp +++ b/src/ring_impl.cpp @@ -95,7 +95,7 @@ BFring_impl::BFring_impl(const char* name, BFspace space) _nread_open(0), _nwrite_open(0), _nrealloc_pending(0), _core(-1), _size_log(std::string("rings/")+name) { -#if defined BF_CUDA_ENABLED && BF_CUDA_ENABLED +#if defined(BF_CUDA_ENABLED) && BF_CUDA_ENABLED BF_ASSERT_EXCEPTION(space==BF_SPACE_SYSTEM || space==BF_SPACE_MAPPED || space==BF_SPACE_CUDA || diff --git a/src/utils.hpp b/src/utils.hpp index 97910443a..84d56530f 100644 --- a/src/utils.hpp +++ b/src/utils.hpp @@ -209,12 +209,12 @@ byteswap(T value, T* result) { } inline BFbool space_accessible_from(BFspace space, BFspace from) { -#if !defined BF_CUDA_ENABLED || !BF_CUDA_ENABLED +#if !defined(BF_CUDA_ENABLED) || !BF_CUDA_ENABLED return ( (space == BF_SPACE_SYSTEM) || (space == BF_SPACE_MAPPED) ); #else switch( from ) { -#if !defined BF_CUDA_ENABLED || !BF_CUDA_ENABLED +#if !defined(BF_CUDA_ENABLED) || !BF_CUDA_ENABLED case BF_CUDA_HOST: // fall-through #endif case BF_SPACE_MAPPED: // fall-through From 56afbddc903a4f26fdc7fff173d07c491591d341 Mon Sep 17 00:00:00 2001 From: jaycedowell Date: Fri, 25 Mar 2022 06:24:41 -0600 Subject: [PATCH 42/48] Match the features of #132. --- src/fileutils.hpp | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/src/fileutils.hpp b/src/fileutils.hpp index 99a7f24f3..263fcea8c 100644 --- a/src/fileutils.hpp +++ b/src/fileutils.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2020, The Bifrost Authors. All rights reserved. + * Copyright (c) 2016-2022, The Bifrost Authors. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -34,6 +34,10 @@ #include // For getpid #include +#if defined(__APPLE__) && __APPLE__ +#include +#endif + inline void make_dir(std::string path, int perms=775) { if( std::system(("mkdir -p -m "+std::to_string(perms)+" "+path).c_str()) ) { throw std::runtime_error("Failed to create path: "+path); @@ -60,9 +64,40 @@ inline bool file_exists(std::string path) { && errno == ENOENT); } inline bool process_exists(pid_t pid) { +#if defined(__APPLE__) && __APPLE__ + + // Based on information from: + // https://developer.apple.com/library/archive/qa/qa2001/qa1123.html + + static const int name[] = { CTL_KERN, KERN_PROC, KERN_PROC_ALL, 0 }; + kinfo_proc *proclist = NULL; + int err, found = 0; + size_t len, count; + len = 0; + err = sysctl((int *) name, (sizeof(name) / sizeof(*name)) - 1, + NULL, &len, NULL, 0); + if( err == 0 ) { + proclist = (kinfo_proc*) ::malloc(len); + err = sysctl((int *) name, (sizeof(name) / sizeof(*name)) - 1, + proclist, &len, NULL, 0); + if( err == 0 ) { + count = len / sizeof(kinfo_proc); + for(int i=0; i Date: Tue, 29 Mar 2022 09:13:39 -0600 Subject: [PATCH 43/48] Updated for new fileutils function names. --- src/memory.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/memory.cpp b/src/memory.cpp index 04998217b..5e703b4f6 100644 --- a/src/memory.cpp +++ b/src/memory.cpp @@ -96,8 +96,8 @@ class MappedMgr { while( (ep = readdir(dp)) ) { pid_t pid = atoi(ep->d_name); if( pid && !process_exists(pid) ) { - remove_all(std::string(base_mapped_dir) + "/" + - std::to_string(pid)); + remove_files_recursively(std::string(base_mapped_dir) + "/" + + std::to_string(pid)); } } closedir(dp); @@ -110,7 +110,7 @@ class MappedMgr { if( fd >= 0 ) { ::close(fd); } - try { remove_file(filename); } + try { remove_file_glob(filename); } catch( std::exception ) {} } MappedMgr() @@ -125,7 +125,7 @@ class MappedMgr { this->free(x->first); } try { - remove_all(_mapped_dir); + remove_files_recursively(_mapped_dir); this->try_base_mapped_dir_cleanup(); } catch( std::exception ) {} } From 159ccb4270dfc53a61fe36bbe539c6b21c5e8e09 Mon Sep 17 00:00:00 2001 From: jaycedowell Date: Tue, 29 Mar 2022 09:16:57 -0600 Subject: [PATCH 44/48] Updated for the new 'mapped' ring space. --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index 8ddacf429..e27c0849f 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,7 @@ 0.10.1 * Cleaned up the Makefile outputs * Added a disk cache for bifrost.map calls + * Added support for a new 'mapped' ring space which is backed by a file on disk 0.10.0 * Switched over to an autotools-based build system From 0693fbb75bfec5749202c62a40324db44cb1e436 Mon Sep 17 00:00:00 2001 From: Christopher League Date: Tue, 29 Mar 2022 12:12:35 -0400 Subject: [PATCH 45/48] Avoid warning about catching polymorphic exception by value MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (Noticed this ×3 in CI.) ``` memory.cpp: In destructor 'MappedMgr::~MappedMgr()': memory.cpp:130:17: warning: catching polymorphic type 'class std::exception' by value [8;; https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wcatch-value= -Wcatch-value=8;;] 130 | } catch( std::exception ) {} | ^~~~~~~~~ ``` --- src/memory.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/memory.cpp b/src/memory.cpp index 5e703b4f6..14944ba9c 100644 --- a/src/memory.cpp +++ b/src/memory.cpp @@ -104,14 +104,14 @@ class MappedMgr { } // Remove the base_logdir if it's empty try { remove_dir(base_mapped_dir); } - catch( std::exception ) {} + catch( std::exception const& ) {} } void cleanup(std::string filename, int fd) { if( fd >= 0 ) { ::close(fd); } try { remove_file_glob(filename); } - catch( std::exception ) {} + catch( std::exception const& ) {} } MappedMgr() : _mapped_dir(std::string(base_mapped_dir) + "/" + std::to_string(getpid())) { @@ -127,7 +127,7 @@ class MappedMgr { try { remove_files_recursively(_mapped_dir); this->try_base_mapped_dir_cleanup(); - } catch( std::exception ) {} + } catch( std::exception const& ) {} } public: MappedMgr(MappedMgr& ) = delete; From d4d337637d5e51b4710fab6292e74a3b02987060 Mon Sep 17 00:00:00 2001 From: jaycedowell Date: Fri, 22 Apr 2022 14:01:15 -0600 Subject: [PATCH 46/48] remove_file_glob -> remove_file. --- src/memory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/memory.cpp b/src/memory.cpp index 14944ba9c..6664b6794 100644 --- a/src/memory.cpp +++ b/src/memory.cpp @@ -110,7 +110,7 @@ class MappedMgr { if( fd >= 0 ) { ::close(fd); } - try { remove_file_glob(filename); } + try { remove_file(filename); } catch( std::exception const& ) {} } MappedMgr() From fa08729eca3542b10f6c925d35f70c33fdbcb3aa Mon Sep 17 00:00:00 2001 From: jaycedowell Date: Fri, 22 Apr 2022 14:22:08 -0600 Subject: [PATCH 47/48] Octal strikes again. --- src/memory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/memory.cpp b/src/memory.cpp index 6664b6794..1df86b4df 100644 --- a/src/memory.cpp +++ b/src/memory.cpp @@ -116,7 +116,7 @@ class MappedMgr { MappedMgr() : _mapped_dir(std::string(base_mapped_dir) + "/" + std::to_string(getpid())) { this->try_base_mapped_dir_cleanup(); - make_dir(base_mapped_dir, 777); + make_dir(base_mapped_dir, 0777); make_dir(_mapped_dir); } ~MappedMgr() { From 0e30bb2362bcdcba6ab6a3921fcc995449f6f812 Mon Sep 17 00:00:00 2001 From: jaycedowell Date: Mon, 25 Apr 2022 10:08:47 -0600 Subject: [PATCH 48/48] Ignore the libbifrost_generated.py file that is automatically created. --- codecov.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/codecov.yml b/codecov.yml index 6c5021390..699f6bcf5 100644 --- a/codecov.yml +++ b/codecov.yml @@ -1,3 +1,5 @@ # https://docs.codecov.com/docs/fixing-paths fixes: - "/home/docker/actions-runner/_work/_tool/Python/3.*/x64/lib/python3.*/site-packages/::python/" +ignore: + - "**/libbifrost_generated.py"