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
113 changes: 61 additions & 52 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:

linux:
name: Ubuntu Latest GCC
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
strategy:
fail-fast: true
steps:
Expand Down Expand Up @@ -90,7 +90,7 @@ jobs:

linux_clang:
name: Ubuntu Latest Clang
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
strategy:
fail-fast: true
steps:
Expand Down Expand Up @@ -164,58 +164,64 @@ jobs:

brlcad_linux:
name: BRL-CAD Linux step-g Test
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
strategy:
fail-fast: true
steps:
- name: Setup - CMake
uses: lukka/get-cmake@latest

- name: Setup - Ninja
uses: seanmiddleditch/gha-setup-ninja@master

- name: Setup - System
env:
DEBIAN_FRONTEND: noninteractive
run: |
sudo apt-get update
# Install dev tools
sudo apt-get install re2c lemon
sudo apt-get install re2c astyle xsltproc libxml2-utils
sudo apt-get install xserver-xorg-dev libx11-dev libxi-dev libxext-dev libglu1-mesa-dev libfontconfig-dev
sudo apt-get install zlib1g-dev libpng-dev libjpeg-dev libtiff-dev libeigen3-dev libgdal-dev libassimp-dev libopencv-dev
sudo apt-get clean

- name: Checkout
- name: Clone bext
run: |
git clone --depth 1 https://github.com/BRL-CAD/brlcad.git -b main
cd brlcad/src/other/ext && rm -rf stepcode
git clone https://github.com/BRL-CAD/bext.git
cd bext/stepcode
cmake -E rm -r stepcode
git clone --depth 1 https://github.com/stepcode/stepcode.git -b develop
# Ordinarily BRL-CAD keeps track of what files are supposed to be
# present in the repository. In this case we're not interested in
# updating the list to the working stepcode filelist, so use an empty
# list instead
echo "set(stepcode_ignore_files)" > stepcode.dist
cd ../../../../
cd ../..

- name: Build bext
run: |
cmake -E make_directory bext_build
cmake -S bext -B bext_build -DCMAKE_BUILD_TYPE=Release -DUSE_GDAL=OFF -DUSE_TCL=OFF -DUSE_QT=OFF -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}\bext_output
cmake --build bext_build --config Release -j2
# We only need the build ouputs (bext_output) after this point, so
# clean up to save space for the main BRL-CAD build.
cmake -E rm -rf bext
cmake -E rm -rf bext_build


- name: Checkout
run: |
git clone --depth 1 https://github.com/BRL-CAD/brlcad.git -b main

- name: Configure
run: |
export PATH=$ENV{GITHUB_WORKSPACE}:$PATH
cd brlcad
cmake -S . -G Ninja -B build -DENABLE_ALL=ON -DCMAKE_BUILD_TYPE=Release -DEXT_BUILD_VERBOSE=ON
cmake -E make_directory brlcad_build
cd brlcad_build
cmake -S ../brlcad -DBRLCAD_EXT_DIR=${{ github.workspace }}\bext_output -DBRLCAD_ENABLE_GDAL=OFF -DBRLCAD_ENABLE_TCL=OFF -DBRLCAD_ENABLE_QT=OFF -G Ninja
cd ..

- name: Build
run: |
export PATH=$ENV{GITHUB_WORKSPACE}:$PATH
cd brlcad
cmake --build build --config Release --target step-g
cd brlcad_build
cmake --build . --target step-g
cd ..

- name: Test
run: |
export PATH=$ENV{GITHUB_WORKSPACE}:$PATH
cd brlcad/build
./bin/step-g ../db/nist/NIST_MBE_PMI_3.stp -o nist3.g
cd ../..
cd brlcad_build
./bin/step-g ../brlcad/db/nist/NIST_MBE_PMI_3.stp -o nist3.g
cd ..


brlcad_windows:
Expand All @@ -227,9 +233,6 @@ jobs:
- name: Setup - CMake
uses: lukka/get-cmake@latest

- name: Setup - Ninja
uses: seanmiddleditch/gha-setup-ninja@master

- name: Add github workspace to path
# https://github.community/t/deprecated-add-path/136621
run: echo "$ENV{GITHUB_WORKSPACE}" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
Expand All @@ -240,38 +243,44 @@ jobs:
- name: Add cl.exe to PATH
uses: ilammy/msvc-dev-cmd@v1

- name: Checkout
- name: Clone bext
run: |
git clone --depth 1 https://github.com/BRL-CAD/brlcad.git -b main
cd brlcad/src/other/ext
git clone https://github.com/BRL-CAD/bext.git
cd bext/stepcode
cmake -E rm -r stepcode
git clone --depth 1 https://github.com/stepcode/stepcode.git -b develop
# Ordinarily BRL-CAD keeps track of what files are supposed to be
# present in the repository. In this case we're not interested in
# updating the list to the working stepcode filelist, so use an empty
# list instead
echo "set(stepcode_ignore_files)" > stepcode.dist
cd ../../../../
cd ../..

- name: Build bext
shell: powershell
run: |
cmake -E make_directory bext_build
cmake -S bext -B bext_build -DCMAKE_BUILD_TYPE=Release -DUSE_GDAL=OFF -DUSE_TCL=OFF -DUSE_QT=OFF -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}\bext_output
cmake --build bext_build --config Release -j2
# We only need the build ouputs (bext_output) after this point, so
# clean up to save space for the main BRL-CAD build.
cmake -E rm -rf bext
cmake -E rm -rf bext_build


- name: Checkout
run: |
git clone --depth 1 https://github.com/BRL-CAD/brlcad.git -b main

- name: Configure
run: |
cd brlcad && cmake -S . -B build -G Ninja -DCMAKE_C_COMPILER="cl.exe" -DCMAKE_CXX_COMPILER="cl.exe" -DSC_ENABLE_TESTING=ON
cd ..
# We do the following in order to help ensure files are "flushed"
# to disk before compilation is attempted
# https://superuser.com/a/1553374/1286142
powershell Write-VolumeCache C
powershell Write-VolumeCache D
cmake -E make_directory brlcad_build
cmake -S brlcad -B brlcad_build -DCMAKE_BUILD_TYPE=Release -DBRLCAD_EXT_DIR=${{ github.workspace }}\bext_output -DBRLCAD_ENABLE_GDAL=OFF -DBRLCAD_ENABLE_TCL=OFF -DBRLCAD_ENABLE_QT=OFF -G Ninja -DCMAKE_C_COMPILER="cl.exe" -DCMAKE_CXX_COMPILER="cl.exe"

- name: Build
run: |
cd brlcad/build
ninja -j1 -v step-g
cd ../..
cd brlcad_build
cmake --build . --config Release --target step-g
cd ..

- name: Test
run: |
cd brlcad/build
./bin/step-g.exe ../db/nist/NIST_MBE_PMI_3.stp -o nist3.g
cd ../..
cd brlcad_build
./bin/step-g.exe ../brlcad/db/nist/NIST_MBE_PMI_3.stp -o nist3.g
cd ..

2 changes: 1 addition & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This repo was moved and renamed in May 2012. Previously, it was at
http://github.com/mpictor/StepClassLibrary

Some are duplicates of changes recorded in the BRL-CAD repo:
http://brlcad.svn.sourceforge.net/viewvc/brlcad/brlcad/trunk/src/other/step/?view=log
https://github.com/BRL-CAD/brlcad/tree/158beae4556d94821938368951546384cba53107/src/other/ext/stepcode

Pre-BRL-CAD changes:
************************************************************************
Expand Down
4 changes: 2 additions & 2 deletions include/cllazyfile/judyS2Array.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ class judyS2Array {
explicit judyS2Array( const judyS2Array< JudyValue > & other ): _maxKeyLen( other._maxKeyLen ), _success( other._success ) {
_judyarray = judy_clone( other._judyarray );
_buff = new unsigned char[_maxKeyLen];
strncpy( _buff, other._buff, _maxKeyLen );
_buff[ _maxKeyLen ] = '\0'; //ensure that _buff is null-terminated, since strncpy won't necessarily do so
strncpy( reinterpret_cast< char * >( _buff ), reinterpret_cast< const char * >( other._buff ), _maxKeyLen - 1 );
_buff[ _maxKeyLen - 1 ] = '\0'; //ensure that _buff is null-terminated
find( _buff ); //set _lastSlot
}

Expand Down
4 changes: 2 additions & 2 deletions include/cllazyfile/judySArray.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ class judySArray {
explicit judySArray( const judySArray< JudyValue > & other ): _maxKeyLen( other._maxKeyLen ), _success( other._success ) {
_judyarray = judy_clone( other._judyarray );
_buff = new unsigned char[_maxKeyLen];
strncpy( _buff, other._buff, _maxKeyLen );
_buff[ _maxKeyLen ] = '\0'; //ensure that _buff is null-terminated, since strncpy won't necessarily do so
strncpy( reinterpret_cast< char * >( _buff ), reinterpret_cast< const char * >( other._buff ), _maxKeyLen - 1 );
_buff[ _maxKeyLen - 1 ] = '\0'; //ensure that _buff is null-terminated
find( _buff ); //set _lastSlot
}

Expand Down
2 changes: 1 addition & 1 deletion include/express/alloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ struct freelist_head {
#endif
};

char * nnew();
char * nnew(void);

#include "error.h"

Expand Down
4 changes: 2 additions & 2 deletions include/express/basic.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@
/* function pointer types */
/**************************/

typedef void ( *voidFuncptr )();
typedef int ( *intFuncptr )();
typedef void ( *voidFuncptr )(void);
typedef int ( *intFuncptr )(void);

/* Option index - can we get rid of this? */
extern SC_EXPRESS_EXPORT int sc_optind;
Expand Down
2 changes: 1 addition & 1 deletion include/express/factory.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@

#include "sc_export.h"

SC_EXPRESS_EXPORT void FACTORYinitialize();
SC_EXPRESS_EXPORT void FACTORYinitialize(void);

#endif /* __FACTORY_H_ */
2 changes: 1 addition & 1 deletion include/express/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@

#include "sc_export.h"

SC_EXPRESS_EXPORT void MEMORYinitialize();
SC_EXPRESS_EXPORT void MEMORYinitialize(void);

#endif // __MEMORY_H
6 changes: 3 additions & 3 deletions src/cldai/sdaiBinary.cc
Original file line number Diff line number Diff line change
Expand Up @@ -121,17 +121,17 @@ Severity SDAI_Binary::ReadBinary( istream & in, ErrorDescriptor * err, int Assig
if( !validDelimiters ) {
err->GreaterSeverity( SEVERITY_WARNING );
if( needDelims )
sprintf( messageBuf,
snprintf( messageBuf, sizeof(messageBuf),
"Binary value missing double quote delimiters.\n" );
else
sprintf( messageBuf,
snprintf( messageBuf, sizeof(messageBuf),
"Mismatched double quote delimiters for binary.\n" );
err->AppendToDetailMsg( messageBuf );
err->AppendToUserMsg( messageBuf );
}
} else {
err->GreaterSeverity( SEVERITY_WARNING );
sprintf( messageBuf, "Invalid binary value.\n" );
snprintf( messageBuf, sizeof(messageBuf), "Invalid binary value.\n" );
err->AppendToDetailMsg( messageBuf );
err->AppendToUserMsg( messageBuf );
}
Expand Down
12 changes: 6 additions & 6 deletions src/cldai/sdaiEnum.cc
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,10 @@ Severity SDAI_LOGICAL::ReadEnum( istream & in, ErrorDescriptor * err, int Assign
if( !validDelimiters ) {
err->GreaterSeverity( SEVERITY_WARNING );
if( needDelims )
sprintf( messageBuf,
snprintf( messageBuf, sizeof(messageBuf),
"Enumerated value has invalid period delimiters.\n" );
else
sprintf( messageBuf,
snprintf( messageBuf, sizeof(messageBuf),
"Mismatched period delimiters for enumeration.\n" );
err->AppendToDetailMsg( messageBuf );
err->AppendToUserMsg( messageBuf );
Expand All @@ -241,7 +241,7 @@ Severity SDAI_LOGICAL::ReadEnum( istream & in, ErrorDescriptor * err, int Assign
} else {
in.putback( c );
err->GreaterSeverity( SEVERITY_WARNING );
sprintf( messageBuf, "Invalid enumeration value.\n" );
snprintf( messageBuf, sizeof(messageBuf), "Invalid enumeration value.\n" );
err->AppendToDetailMsg( messageBuf );
err->AppendToUserMsg( messageBuf );
}
Expand Down Expand Up @@ -489,10 +489,10 @@ Severity SDAI_Enum::ReadEnum( istream & in, ErrorDescriptor * err, int AssignVal
if( !validDelimiters ) {
err->GreaterSeverity( SEVERITY_WARNING );
if( needDelims )
sprintf( messageBuf,
snprintf( messageBuf, sizeof(messageBuf),
"Enumerated value has invalid period delimiters.\n" );
else
sprintf( messageBuf,
snprintf( messageBuf, sizeof(messageBuf),
"Mismatched period delimiters for enumeration.\n" );
err->AppendToDetailMsg( messageBuf );
err->AppendToUserMsg( messageBuf );
Expand All @@ -519,7 +519,7 @@ Severity SDAI_Enum::ReadEnum( istream & in, ErrorDescriptor * err, int AssignVal
} else {
in.putback( c );
err->GreaterSeverity( SEVERITY_WARNING );
sprintf( messageBuf, "Invalid enumeration value.\n" );
snprintf( messageBuf, sizeof(messageBuf), "Invalid enumeration value.\n" );
err->AppendToDetailMsg( messageBuf );
err->AppendToUserMsg( messageBuf );
}
Expand Down
18 changes: 9 additions & 9 deletions src/cleditor/STEPfile.cc
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ int STEPfile::ReadData1( istream & in ) {
} // end while loop

if( _entsNotCreated ) {
sprintf( buf,
snprintf( buf, sizeof(buf),
"STEPfile Reading File: Unable to create %d instances.\n\tIn first pass through DATA section. Check for invalid entity types.\n",
_entsNotCreated );
_error.AppendToUserMsg( buf );
Expand Down Expand Up @@ -647,7 +647,7 @@ int STEPfile::ReadData2( istream & in, bool useTechCor ) {
} // end while loop

if( _entsInvalid ) {
sprintf( buf,
snprintf( buf, sizeof(buf),
"%s \n\tTotal instances: %d \n\tInvalid instances: %d \n\tIncomplete instances (includes invalid instances): %d \n\t%s: %d.\n",
"Second pass complete - instance summary:", total_instances,
_entsInvalid, _entsIncomplete, "Warnings",
Expand Down Expand Up @@ -1321,7 +1321,7 @@ SDAI_Application_instance * STEPfile::ReadInstance( istream & in, ostream & out,
}
} else {
if( node->CurrState() == completeSE ) {
sprintf( errbuf, "WARNING in WORKING FILE: changing instance #%d state from completeSE to incompleteSE.\n", fileid );
snprintf( errbuf, sizeof(errbuf), "WARNING in WORKING FILE: changing instance #%d state from completeSE to incompleteSE.\n", fileid );
_error.AppendToUserMsg( errbuf );
if( _fileType != WORKING_SESSION ) {
node->ChangeState( incompleteSE );
Expand Down Expand Up @@ -1643,7 +1643,7 @@ Severity STEPfile::AppendFile( istream * in, bool useTechCor ) {
}
SetFileType( WORKING_SESSION );
} else {
sprintf( errbuf,
snprintf( errbuf, sizeof(errbuf),
"Faulty input at beginning of file. \"ISO-10303-21;\" or"
" \"STEP_WORKING_SESSION;\" expected. File not read: %s\n",
( ( FileName().compare( "-" ) == 0 ) ? "standard input" : FileName().c_str() ) );
Expand All @@ -1658,14 +1658,14 @@ Severity STEPfile::AppendFile( istream * in, bool useTechCor ) {
rval = ReadHeader( *in );
cout << "\nHEADER read:";
if( rval < SEVERITY_WARNING ) {
sprintf( errbuf,
snprintf( errbuf, sizeof(errbuf),
"Error: non-recoverable error in reading header section. "
"There were %d errors encountered. Rest of file is ignored.\n",
_errorCount );
_error.AppendToUserMsg( errbuf );
return rval;
} else if( rval != SEVERITY_NULL ) {
sprintf( errbuf, " %d ERRORS\t %d WARNINGS\n\n",
snprintf( errbuf, sizeof(errbuf), " %d ERRORS\t %d WARNINGS\n\n",
_errorCount, _warningCount );
cout << errbuf;
} else {
Expand All @@ -1683,7 +1683,7 @@ Severity STEPfile::AppendFile( istream * in, bool useTechCor ) {

cout << "\nFIRST PASS complete: " << total_insts
<< " instances created.\n";
sprintf( errbuf,
snprintf( errbuf, sizeof(errbuf),
" %d ERRORS\t %d WARNINGS\n\n",
_errorCount, _warningCount );
cout << errbuf;
Expand Down Expand Up @@ -1727,7 +1727,7 @@ Severity STEPfile::AppendFile( istream * in, bool useTechCor ) {
//check for "ENDSEC;"
ReadTokenSeparator( *in2 );
if( total_insts != valid_insts ) {
sprintf( errbuf, "%d invalid instances in file: %s\n",
snprintf( errbuf, sizeof(errbuf), "%d invalid instances in file: %s\n",
total_insts - valid_insts, ( ( FileName().compare( "-" ) == 0 ) ? "standard input" : FileName().c_str() ) );
_error.AppendToUserMsg( errbuf );
CloseInputFile( in2 );
Expand All @@ -1736,7 +1736,7 @@ Severity STEPfile::AppendFile( istream * in, bool useTechCor ) {

cout << "\nSECOND PASS complete: " << valid_insts
<< " instances valid.\n";
sprintf( errbuf,
snprintf( errbuf, sizeof(errbuf),
" %d ERRORS\t %d WARNINGS\n\n",
_errorCount, _warningCount );
_error.AppendToUserMsg( errbuf );
Expand Down
Loading
Loading