Skip to content

Commit

Permalink
Merge release
Browse files Browse the repository at this point in the history
  • Loading branch information
felix-salfelder committed Aug 18, 2020
2 parents e24d007 + e6dfaff commit 06e1a6c
Show file tree
Hide file tree
Showing 15 changed files with 168 additions and 138 deletions.
2 changes: 1 addition & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ build_script:

## Build
- bash -lc "exec 0</dev/null && cd $APPVEYOR_BUILD_FOLDER && ./bootstrap.sh"
- bash -lc "exec 0</dev/null && cd $APPVEYOR_BUILD_FOLDER && ./configure --enable-maintainer-mode --prefix=/c/adms-win%MBITS% --disable-shared"
- bash -lc "exec 0</dev/null && cd $APPVEYOR_BUILD_FOLDER && ./configure --prefix=/c/adms-win%MBITS% --disable-shared"
- bash -lc "exec 0</dev/null && cd $APPVEYOR_BUILD_FOLDER && make distcheck"
- bash -lc "exec 0</dev/null && cd $APPVEYOR_BUILD_FOLDER && make install"

Expand Down
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ script:
- case $BUILD_SYSTEM in
autotools)
./bootstrap.sh &&
./configure --enable-maintainer-mode --prefix=/usr &&
./configure --prefix=/usr &&
make distcheck &&
sudo make install
;;
cmake)
mkdir build && cd build &&
cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DUSE_MAINTAINER_MODE=ON &&
cmake .. -DCMAKE_INSTALL_PREFIX=/usr &&
make &&
sudo make install
;;
Expand Down
27 changes: 13 additions & 14 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,13 @@ endif()
PROJECT(ADMS C)
cmake_minimum_required(VERSION 2.8)

# TODO: store version in a sensible place
# e.g. qucs: file(STRINGS "${qucs-project_SOURCE_DIR}/VERSION" QUCS_VERSION)

SET(PACKAGE_NAME "adms")
SET(PACKAGE_VERSION "2.3.6")
SET(PACKAGE_VERSION "2.3.7")
SET(PACKAGE_BUGREPORT "[email protected]")

OPTION ( USE_MAINTAINER_MODE "Enable generation of code (parser source) from Perl scripts." OFF )

# Default to static libs ( shared needs work, BUG with MinGW).
OPTION ( BUILD_STATIC_LIBS "Build static libraries." ON )
IF ( MINGW )
Expand All @@ -54,20 +55,18 @@ CHECK_FUNCTION_EXISTS (putenv HAVE_PUTENV)

CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)

# Only care about Perl in case maintainer needs to recreate sources
# Perl is used to recreate sources
# * mkelements.pl
# * mktext.pl
# * mkgrammar.pl
if ( USE_MAINTAINER_MODE )
# Checking for perl modules requires FindPerlModules.cmake
# Check all required modules at once
SET(CMAKE_MODULE_PATH "${ADMS_SOURCE_DIR}/cmake/modules")
include(FindPerlModules)
find_package(PerlModules COMPONENTS XML::LibXML)
if(NOT PERLMODULES_FOUND)
message(FATAL_ERROR "Not all required perl modules were found on your system")
endif(NOT PERLMODULES_FOUND)
endif ( USE_MAINTAINER_MODE )
# Checking for perl modules requires FindPerlModules.cmake
# Check all required modules at once
SET(CMAKE_MODULE_PATH "${ADMS_SOURCE_DIR}/cmake/modules")
include(FindPerlModules)
find_package(PerlModules COMPONENTS XML::LibXML)
if(NOT PERLMODULES_FOUND)
message(FATAL_ERROR "Not all required perl modules were found on your system")
endif(NOT PERLMODULES_FOUND)


find_package(BISON 2.5)
Expand Down
8 changes: 4 additions & 4 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
adms-2.3.6:
* Fix parser for parameter lists in subdevice instanciation.
* Fix parser for parameter lists in subdevice instantiation.
* Remove duplicated constants on provided headers.
* Fix crash on x64 when printing the message about standard headers.

Expand All @@ -20,11 +20,11 @@ adms-2.3.5:
* Autotools, add back support for static and shared libraries build.
* Build shared libraries by default. Tested on Linux, Mac OSX, and MSYS2.
See the configure --disable-shared flag to change that.
* CMake contiues to builds static libraries only.
* CMake continues to builds static libraries only.

* Fix out-of-tree build for Autotools and CMake.

* Check scaling factors againd LRM v2.4.0
* Check scaling factors against LRM v2.4.0
* Add missing K scaling (uppercase kilo)
* standard scale_factor T|G|M|K|k|m|u|n|p|f|a
* Add testset (va and xml files) to test the scaling factors
Expand All @@ -49,7 +49,7 @@ adms-2.3.4:
* avoid spurious fatal error from an included file which last line contains
onlywhite space.
* preprocessorYacc.y:
* fix BSIM6 parse problem, string macro arg broken by continuator
* fix BSIM6 parse problem, string macro arg broken by line continuation
caused 'unexpected end-of-line' error.
* verilogLex.l:
* Change string recognition to allow embedded \" as literal quote
Expand Down
8 changes: 5 additions & 3 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@
mica: same c code as 1.1.8
03-05-2005: removed admsNS directory
release adms-2.0.1



===== gap ====
21-11-2016: 2.3.6
**-08-2020: 2.3.7. minor release.
reproducible build, typo fixes,
include path, instructions
31 changes: 20 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ ADMS is known to work on these platforms.
- GNU Flex
- GNU Bison (tested with 2.5+)
- GNU Libtool
- Perl with XML::LibXml (only for maintainers)
- Perl with XML::LibXml
- GD modules to manually update documentation images

Installing dependencies on Linux Debian/Ubuntu:
Expand All @@ -58,34 +58,30 @@ This section is relevant in case ADMS is compiled from the Git repository.

#### Compilation Using Autotools

The `--enable-maintainer-mode` makes sure the required files are generated (using Perl and LibXml).
Use the default commands to compile, generate files and install.

sh bootstrap.sh
./configure --enable-maintainer-mode
./configure
make install

Autotools it currently used for creating release packages, the `adms-x.x.x.tar.gz` source code archive.

sh bootstrap.sh
./configure --enable-maintainer-mode
./configure
make clean
make dist

#### Compilation Using CMake

The `-DUSE_MAINTAINER_MODE=ON` makes sure the required files are generated (using Perl and LibXml).

mkdir cmake; cd cmake
cmake .. -DUSE_MAINTAINER_MODE=ON -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=/install/location/
cmake .. -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=/install/location/
make install

Packaging is not yet supported with CMake. At the moment, only static libraries can be build with CMake.


### Users Install from Tarball

This section is relevant in case ADMS is compiled from a source code archive (`adms-x.x.x.tar.gz`).
Users should be able to build without Perl (and the maintainer required modules XML::LibXml and GD).

#### Compilation Using Autotools

Expand All @@ -103,6 +99,19 @@ Users should be able to build without Perl (and the maintainer required modules
make install


#### Building an RPM

Go through all the aclocal/automake/configure process to ensure you have all the dependencies installed.

Chances are you will need to install these packages: gcc-c++ flex bison libtool libtool-ltdl-devel

Then rename the ADSM directory to ADSM-2.3.0 and tar it to make ~/rpmbuild/SOURCES/ADMS-2.3.0.tar.gz

Then copy the spec file into your rpmbuild/SPECS directory

Then build with rpmbuild -ba SPECS/adms.spec


## Credits

See AUTHORS file.
Expand Down Expand Up @@ -189,9 +198,9 @@ Original author's build instructions: (for posterity)
3- run: libtoolize --force --ltdl -c (create libltdl and config.guess, config.sub, ltmain.sh in auxconf)
4- run: automake -a -c (create missing, mkinstalldirs, install-sh in auxconf and all Makefile.in)
5- run: autoconf (create configure)
6- run: ./configure --enable-maintainer-mode
6- run: ./configure
In three shots:
rm -rf auxconf && autoheader && mkdir auxconf && aclocal && libtoolize --force --ltdl -c
touch ChangeLog && automake -a -c && autoconf
./configure --enable-maintainer-mode
./configure
```
134 changes: 65 additions & 69 deletions admsXml/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,81 +22,77 @@ INCLUDE_DIRECTORIES( ${CMAKE_BINARY_DIR} ) # for config.h
INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR} ) # for admsPreprocessor.h, amdsVeriloga.h
INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR} ) # for generated source code

# Maintainer mode runs the Perl scrips that generate source code
if ( USE_MAINTAINER_MODE )

# Run mkelements.pl
# Read in `adms.xml` and generete portions of adms and admst
# Generate outputs:
# adms.h
# adms.c
# admstpathYacc.y
# admstpathYacc.h
# admstpath.dtd
MESSAGE(STATUS "Running mkelements.pl code generator")
# Run the Perl scrips to generate source code
# Run mkelements.pl
# Read in `adms.xml` and generete portions of adms and admst
# Generate outputs:
# adms.h
# adms.c
# admstpathYacc.y
# admstpathYacc.h
# admstpath.dtd
MESSAGE(STATUS "Running mkelements.pl code generator")

EXECUTE_PROCESS(
COMMAND perl ${CMAKE_SOURCE_DIR}/admsXml/mkelements.pl ${CMAKE_SOURCE_DIR}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
RESULT_VARIABLE element_result )

IF(element_result EQUAL 0)
MESSAGE(STATUS "mkelement.pl completed successfully")
ELSE(element_result EQUAL 0)
MESSAGE(FATAL_ERROR "mkelement.pl failed. Exit code: ${element_result}")
ENDIF(element_result EQUAL 0)


# Run mkctext.pl
# Wrap source files as C code
# Generate outputs:
# constants.vams.c
# disciplines.vams.c
# adms.implicit.xml.c
# dummy.va.c
# dummy.xml.c
SET(CTEXT
constants.vams
disciplines.vams
adms.implicit.xml
dummy.va
dummy.xml )

FOREACH( inc ${CTEXT} )
MESSAGE(STATUS "Running mkctext.pl code generator on ${inc}")

EXECUTE_PROCESS(
COMMAND perl ${CMAKE_SOURCE_DIR}/admsXml/mkelements.pl ${CMAKE_SOURCE_DIR}
COMMAND perl ${CMAKE_CURRENT_SOURCE_DIR}/mkctext.pl ${CMAKE_CURRENT_SOURCE_DIR}/${inc}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
RESULT_VARIABLE element_result )

IF(element_result EQUAL 0)
MESSAGE(STATUS "mkelement.pl completed successfully")
ELSE(element_result EQUAL 0)
MESSAGE(FATAL_ERROR "mkelement.pl failed. Exit code: ${element_result}")
ENDIF(element_result EQUAL 0)


# Run mkctext.pl
# Wrap source files as C code
# Generate outputs:
# constants.vams.c
# disciplines.vams.c
# adms.implicit.xml.c
# dummy.va.c
# dummy.xml.c
SET(CTEXT
constants.vams
disciplines.vams
adms.implicit.xml
dummy.va
dummy.xml )

FOREACH( inc ${CTEXT} )
MESSAGE(STATUS "Running mkctext.pl code generator on ${inc}")

EXECUTE_PROCESS(
COMMAND perl ${CMAKE_CURRENT_SOURCE_DIR}/mkctext.pl ${CMAKE_CURRENT_SOURCE_DIR}/${inc}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
RESULT_VARIABLE text_result )

IF(text_result EQUAL 0)
MESSAGE(STATUS "mkctext.pl completed successfully")
ELSE(text_result EQUAL 0)
MESSAGE(FATAL_ERROR "mkctext.pl failed. Exit code: ${text_result}")
ENDIF(text_result EQUAL 0)
ENDFOREACH()


# Run mkgrammar.pl
# Process verilogaYacc.y.in and generate the parser
# Generate output:
# verilogaYacc.y
#
MESSAGE(STATUS "Running mkgrammar.pl code generator")
RESULT_VARIABLE text_result )

EXECUTE_PROCESS(
COMMAND perl ${CMAKE_CURRENT_SOURCE_DIR}/mkgrammar.pl ${CMAKE_CURRENT_SOURCE_DIR}/verilogaYacc.y.in
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
RESULT_VARIABLE grammar_result )
IF(text_result EQUAL 0)
MESSAGE(STATUS "mkctext.pl completed successfully")
ELSE(text_result EQUAL 0)
MESSAGE(FATAL_ERROR "mkctext.pl failed. Exit code: ${text_result}")
ENDIF(text_result EQUAL 0)
ENDFOREACH()


# Run mkgrammar.pl
# Process verilogaYacc.y.in and generate the parser
# Generate output:
# verilogaYacc.y
#
MESSAGE(STATUS "Running mkgrammar.pl code generator")

IF(grammar_result EQUAL 0)
MESSAGE(STATUS "mkgrammar.pl completed successfully")
ELSE(grammar_result EQUAL 0)
MESSAGE(FATAL_ERROR "mkgrammar.pl failed. Exit code: ${grammar_result}")
ENDIF(grammar_result EQUAL 0)
EXECUTE_PROCESS(
COMMAND perl ${CMAKE_CURRENT_SOURCE_DIR}/mkgrammar.pl ${CMAKE_CURRENT_SOURCE_DIR}/verilogaYacc.y.in
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
RESULT_VARIABLE grammar_result )

ENDIF ( USE_MAINTAINER_MODE )
IF(grammar_result EQUAL 0)
MESSAGE(STATUS "mkgrammar.pl completed successfully")
ELSE(grammar_result EQUAL 0)
MESSAGE(FATAL_ERROR "mkgrammar.pl failed. Exit code: ${grammar_result}")
ENDIF(grammar_result EQUAL 0)

# Issue with flex:
# BISON_TARGET, FLEX_TARGET and ADD_FLEX_BISON_DEPENDENCY
Expand Down
11 changes: 2 additions & 9 deletions admsXml/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,6 @@ SUFFIXES=.vams .vams.c .va .va.c .xml .xml.c .y.in
# use mkctext.pl to create C files containing the contents of each input file
# in a C character array. The output is used by make check only

# Perl XML::LibXml module are only required for maintainer
# Parser created by maintainer
# BUG: these rules are also required when building from git.
# workaround: default to maintainer mode when building from git.
if MAINTAINER_MODE

$(incfilec):%.c:% ${srcdir}/mkctext.pl
$(PERL) ${srcdir}/mkctext.pl $< $(top_srcdir)

Expand All @@ -25,8 +19,6 @@ admstpathYacc.y admstpathYacc.h adms.h adms.c: ${top_srcdir}/adms.xml ${top_srcd
verilogaYacc.y: ${srcdir}/verilogaYacc.y.in ${srcdir}/mkgrammar.pl
$(PERL) ${srcdir}/mkgrammar.pl ${srcdir}/verilogaYacc.y.in

endif

dist_man_MANS = admsXml.1 admsCheck.1

lib_LTLIBRARIES=libadmsElement.la libadmsPreprocessor.la libadmsVeriloga.la libadmsAdmstpath.la
Expand All @@ -41,7 +33,7 @@ libadmsPreprocessor_la_CPPFLAGS=-DinsidePreprocessor
libadmsPreprocessor_la_LDFLAGS=-no-undefined
libadmsPreprocessor_la_LIBADD=libadmsElement.la

verilogYacc.h: verilogYacc.c
verilogaYacc.h: verilogaYacc.c
libadmsVeriloga_la_SOURCES=verilogaYacc.y verilogaLex.l verilogaYacc.h
libadmsVeriloga_la_CPPFLAGS=-DinsideVeriloga
libadmsVeriloga_la_LDFLAGS=-no-undefined
Expand All @@ -58,6 +50,7 @@ bin_PROGRAMS=admsXml admsCheck

admsXml_SOURCES=admsXml.c
admsXml_LDADD=-lm libadmsElement.la libadmsVeriloga.la libadmsPreprocessor.la libadmsAdmstpath.la
admsXml_CPPFLAGS=${AM_CPPFLAGS} -DADMS_INCLUDEDIR=\"${pkgincludedir}\"

admsXml.c: adms.implicit.xml.c

Expand Down
4 changes: 4 additions & 0 deletions admsXml/adms.implicit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,9 @@
</admst:otherwise>
</admst:choose>
</admst:when>
<admst:when test="[name='\$port_connected']">
<admst:value-to select="dependency" string="constant"/>
</admst:when>
<admst:otherwise>
<admst:apply-templates select="arguments" match="e:dependency"/>
<admst:choose>
Expand Down Expand Up @@ -191,6 +194,7 @@
name='idt' or
name='ddt' or
name='\$param_given' or
name='\$port_connected' or
name='\$given' or
name='ddx' or
name='flicker_noise' or
Expand Down
Loading

0 comments on commit 06e1a6c

Please sign in to comment.