Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions CSG/tests/CSGDemoTest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,7 @@ struct CSGDemoTest


// IT IS EXPEDIENT FOR ALL TEST GEOMETRIES TO LIVE IN THE SAME TREE
#ifdef __APPLE__
const char* CSGDemoTest::BASE = "$TMP/GeoChain_Darwin" ;
#else
const char* CSGDemoTest::BASE = "$TMP/GeoChain" ;
#endif


CSGDemoTest::CSGDemoTest(const char* geom_)
Expand Down
10 changes: 0 additions & 10 deletions CSGOptiX/tests/CSGOptiXRenderTest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -158,16 +158,6 @@ int main(int argc, char** argv)

SEventConfig::SetRGModeRender();

#ifdef __APPLE__
LOG(error)
<< " rendering can be made to work with small GEOM on macOS"
<< " but its crashing with large GEOM : so disabling that "
<< " as thats using ancient CUDA and OptiX are disabling that "
;
return 0 ;
#endif


SSim::Create();

CSGOptiXRenderTest t;
Expand Down
4 changes: 0 additions & 4 deletions g4cx/G4CXOpticks.cc
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,7 @@ void G4CXOpticks::Finalize() // static
LOG(LEVEL);
}

#ifdef __APPLE__
bool G4CXOpticks::NoGPU = true ;
#else
bool G4CXOpticks::NoGPU = false ;
#endif
void G4CXOpticks::SetNoGPU(bool no_gpu){ NoGPU = no_gpu ; }
bool G4CXOpticks::IsNoGPU(){ return NoGPU ; }

Expand Down
9 changes: 3 additions & 6 deletions sysrap/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ find_package(glew REQUIRED)
find_package(glfw3 REQUIRED)
find_package(glm REQUIRED)
find_package(CUDAToolkit REQUIRED)
find_package(OpenSSL REQUIRED)

set(Custom4_VERBOSE ON)
find_package(Custom4 CONFIG)
Expand Down Expand Up @@ -604,14 +605,10 @@ target_link_libraries(${name} CUDA::cudart
GLEW::glew
glm::glm
glfw
OpenSSL::SSL
OpenSSL::Crypto
)

if(UNIX AND NOT APPLE)
find_package(OpenSSL REQUIRED)
message(STATUS "adding ssl crypto for UNIX AND NOT APPLE")
target_link_libraries( ${name} OpenSSL::SSL OpenSSL::Crypto )
endif()

target_include_directories( ${name} PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/sysrap/inc>
Expand Down
13 changes: 0 additions & 13 deletions sysrap/SGLFW.h
Original file line number Diff line number Diff line change
Expand Up @@ -927,25 +927,12 @@ inline void SGLFW::init()

gleqInit();

#if defined __APPLE__
glfwWindowHint (GLFW_CONTEXT_VERSION_MAJOR, 3); // version specifies the minimum, not what will get on mac
glfwWindowHint (GLFW_CONTEXT_VERSION_MINOR, 2);
glfwWindowHint (GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
glfwWindowHint (GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);

#elif defined _MSC_VER
glfwWindowHint (GLFW_CONTEXT_VERSION_MAJOR, 4);
glfwWindowHint (GLFW_CONTEXT_VERSION_MINOR, 1);

#elif __linux
glfwWindowHint (GLFW_CONTEXT_VERSION_MAJOR, 4);
glfwWindowHint (GLFW_CONTEXT_VERSION_MINOR, 1); // also used 6 here
//glfwWindowHint (GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE); // remove stuff deprecated in requested release
glfwWindowHint (GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
glfwWindowHint( GLFW_OPENGL_DEBUG_CONTEXT, GL_TRUE);
// https://learnopengl.com/In-Practice/Debugging Debug output is core since OpenGL version 4.3,
#endif


// HMM: using fullscreen mode with resolution less than display changes display resolution
GLFWmonitor* monitor = gm.fullscreen ? glfwGetPrimaryMonitor() : nullptr ; // nullptr for windowed mode
Expand Down
13 changes: 0 additions & 13 deletions sysrap/SGLFW_Mesh.h
Original file line number Diff line number Diff line change
Expand Up @@ -181,17 +181,6 @@ inline void SGLFW_Mesh::render_drawElements() const

if(instancecount > 0)
{

#ifdef __APPLE__
glDrawElementsInstanced(mode, count, type, indices, instancecount );
if(DUMP && render_count < 10 ) std::cout
<< "SGLFW_Mesh::render_drawElements.glDrawElementsInstanced"
<< " render_count " << render_count
<< " instancecount " << instancecount
<< std::endl
;

#else
GLint basevertex = 0 ;
GLuint baseinstance = 0 ;
glDrawElementsInstancedBaseVertexBaseInstance(mode, count, type, indices, instancecount, basevertex, baseinstance );
Expand All @@ -203,8 +192,6 @@ inline void SGLFW_Mesh::render_drawElements() const
<< " instancecount " << instancecount
<< std::endl
;
#endif

}
else
{
Expand Down
112 changes: 0 additions & 112 deletions sysrap/SProc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,79 +19,6 @@

#include "SProc.hh"
#include "SLOG.hh" // needed for plog::info enum etc..


#ifdef _MSC_VER
float SProc::VirtualMemoryUsageMB()
{
return 0 ;
}

#elif defined(__APPLE__)

#include<mach/mach.h>

/**

https://developer.apple.com/forums/thread/105088

**/


float SProc::VirtualMemoryUsageKB()
{
struct mach_task_basic_info info;
mach_msg_type_number_t size = MACH_TASK_BASIC_INFO_COUNT;
kern_return_t kerr = task_info(mach_task_self(),
MACH_TASK_BASIC_INFO,
(task_info_t)&info,
&size);

if( kerr == KERN_SUCCESS )
{
vm_size_t vsize_ = info.virtual_size ;
unsigned long long vsize(vsize_);
unsigned long long KB = 1000 ;
float usage = float(vsize/KB) ;
return usage ;
}

LOG(error) << mach_error_string(kerr) ;

return 0 ;
}



float SProc::ResidentSetSizeKB()
{
struct mach_task_basic_info info;
mach_msg_type_number_t size = MACH_TASK_BASIC_INFO_COUNT;
kern_return_t kerr = task_info(mach_task_self(),
MACH_TASK_BASIC_INFO,
(task_info_t)&info,
&size);

if( kerr == KERN_SUCCESS )
{
vm_size_t rsize_ = info.resident_size ;
unsigned long long rsize(rsize_);
unsigned long long KB = 1000 ;
float usage = float(rsize/KB) ;
return usage ;
}

LOG(error) << mach_error_string(kerr) ;

return 0 ;
}






#else

// https://stackoverflow.com/questions/63166/how-to-determine-cpu-and-memory-consumption-from-inside-a-process

Expand Down Expand Up @@ -152,8 +79,6 @@ float SProc::ResidentSetSizeKB()
}


#endif

float SProc::VirtualMemoryUsageMB()
{
float result = VirtualMemoryUsageKB() ;
Expand All @@ -167,10 +92,6 @@ float SProc::ResidentSetSizeMB()
}






/**
SProc::ExecutablePath
-----------------------
Expand All @@ -179,35 +100,6 @@ SProc::ExecutablePath

**/


#ifdef _MSC_VER
const char* SProc::ExecutablePath(bool basename)
{
return NULL ;
}
#elif defined(__APPLE__)

#include <mach-o/dyld.h>

const char* SProc::ExecutablePath(bool basename)
{
char buf[PATH_MAX];
uint32_t size = sizeof(buf);
bool ok = _NSGetExecutablePath(buf, &size) == 0 ;

LOG_IF(fatal, !ok)
<< "_NSGetExecutablePath FAIL "
<< " size " << size
<< " buf " << buf
;

assert(ok);
const char* s = basename ? strrchr(buf, '/') : NULL ;
return s ? strdup(s+1) : strdup(buf) ;
}
#else


#include <unistd.h>
#include <limits.h>

Expand All @@ -221,13 +113,9 @@ const char* SProc::ExecutablePath(bool basename)
return s ? strdup(s+1) : strdup(buf) ;
}

#endif


const char* SProc::ExecutableName()
{
bool basename = true ;
return ExecutablePath(basename);
}


48 changes: 1 addition & 47 deletions sysrap/SStackFrame.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,50 +82,6 @@ inline char* SStackFrame::TrimArgs(const char* signature)
}


#ifdef __APPLE__
inline void SStackFrame::parse()
{
/**
4 libG4processes.dylib 0x00000001090baee5 _ZN12G4VEmProcess36PostStepGetPhysicalInteractionLengthERK7G4TrackdP16G4ForceCondition + 661
**/
for( char *p = line ; *p ; ++p )
{
if (( *p == '_' ) && ( *(p-1) == ' ' )) name = p-1; // starting from first underscore after space
else if ( *p == '+' ) offset = p-1;
}

if( name && offset && ( name < offset ))
{
*name++ = '\0'; // plant terminator into line
*offset++ = '\0'; // plant terminator into name
func = demangle();
}

}


inline void SStackFrame::dump(std::ostream& out)
{
if( func )
{
out
<< std::setw(30) << std::left << line
<< " "
<< std::setw(100) << std::left << func
<< " "
<< std::setw(10) << std::left << offset
<< " "
<< std::endl
;
}
else
{
out << line << std::endl ;

}
}

#else
inline void SStackFrame::parse()
{
/**
Expand All @@ -146,6 +102,7 @@ inline void SStackFrame::parse()
func = demangle();
}
}

inline void SStackFrame::dump(std::ostream& out)
{
if( func )
Expand All @@ -164,13 +121,10 @@ inline void SStackFrame::dump(std::ostream& out)

}
}
#endif

inline char* SStackFrame::demangle() // demangling fails for non C++ symbols
{
int status;
char* ret = abi::__cxa_demangle( name, NULL, NULL, &status );
return status == 0 ? ret : NULL ;
}


20 changes: 0 additions & 20 deletions sysrap/SSys.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,34 +37,14 @@
#include "SStr.hh"
#include "SLOG.hh"


#include "scuda.h"



/*
simon:optixrap blyth$ python -c 'import sys, os, numpy as np ; sys.exit(214) '
simon:optixrap blyth$ echo $?
214
*/

extern char **environ;



const plog::Severity SSys::LEVEL = SLOG::EnvLevel("SSys", "DEBUG") ;


#ifdef __APPLE__
const char* SSys::OS = "Darwin" ;
#else
const char* SSys::OS = "Linux" ;
#endif







void SSys::DumpEnv(const char* pfx ) // static
Expand Down
Loading