Skip to content
Open
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
46 changes: 46 additions & 0 deletions DEVELOPER/LinuxInstructions_EESD_EPFL.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
"""
Created on Wed Jul 1 2020
@author: vanin
"""

###############################################
Procedure executed on virtual machine with next configuration:
LSB Version: no LSB modules available
Distributor ID: Ubuntu
Description: Ubuntu 20.04 LTS
Release: 20.04
Codename: focal
user_name: osboxes
###############################################

STEP 1: Download and configuring Opensees
1. Checking out the prerequisites:
sudo apt-get install make tcl8.6 tcl8.6-dev gcc g++ gfortran python3-dev

2. Download OpenSees source from: https://github.com/eesd-epfl/OpenSees. Place it in /home/user_name ("Home" directory)

3. Create (if not existing yet) bin and lib folders in “home user” directory. Ex: /home/user_name/bin, /home/user_name/lib

4. Extract “OpenSees-master.zip” in “Home” directory and rename it to “OpenSees”

5a. If using the tools only with external libraries, go to DEVELOPER and open Makefile, delete line 23 and save.
Execute "make" in the DEVELOPER folder and copy the libraries in the element/cpp/Macroelement3d/Macroelement3d and material/cpp folders. Following steps are not necessary.
Consider that section types cannot be used as external libraries.

5. If instead all tools are needed, including section models (OrthotropicMembraneSection, NoTensionSection3d) the executable has to be rebuilt.
Go inside OpenSees source, in folder “MAKES” open “Makefile.def.EC2-UBUNTU” file.

6. Modify it to add the developer libraries to the compiled version:
- line 90: change path to "/usr/local"
- line 91: change path to "/home/user_name" (change user_name to the actual user name)
- add new line after line 103: "DEVdir = $(HOME)/OpenSees/DEVELOPER"
- in what is now line 108, after "$(SRCdir)" add " $(DEVdir) "
- save file

7. Compiling: Open terminal being in "OpenSees” folder. Execute “cp ./MAKES/Makefile.def.EC2-UBUNTU ./Makefile.def”. Execute then “make”.
The libraries in the DEVELOPER folder will be linked to the main SRC code. It has to be used with the SRC folder from the repository https://github.com/eesd-epfl/OpenSees, which includes in section, element and material
Tcl commands the references to the added libraries (linked in SRC/Makefile.incl and added to the main FE library through in line 23 of the DEVELOPER Makefile)

8. After compiling, a binary file called “OpenSees” is created in “bin” folder (created in step 3).


39 changes: 39 additions & 0 deletions DEVELOPER/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@

include ./Makefile.def
include ../Makefile.def

DEVELOPER_LIBS = ./element/cpp/Macroelement3d/Macroelement3d/CohesiveSurface.o \
./element/cpp/Macroelement3d/Macroelement3d/DamageShearInterface.o \
./element/cpp/Macroelement3d/Macroelement3d/GambarottaLagomarsinoModel.o \
./element/cpp/Macroelement3d/Macroelement3d/GenericDamagePlasticityShear.o \
./element/cpp/Macroelement3d/Macroelement3d/Macroelement3d.o \
./element/cpp/Macroelement3d/Macroelement3d/NoTensionSection3d.o \
./element/cpp/Macroelement3d/Macroelement3d/WrappedMaterial.o \
./material/cpp/BeamFrictionSupport/BeamFrictionSupport/BeamFrictionSupport.o \
./material/cpp/CompressionDamage1d/CompressionDamage1d/CompressionDamage1d.o \
./material/cpp/TensionDamage1d/TensionDamage1d/TensionDamage1d.o \
./material/cpp/OrthotropicMembraneSection/OrthotropicMembraneSection.o

all:
@cd ./element; $(MAKE);
@cd ./material; $(MAKE);
# @cd ./recorder; $(MAKE);
# @cd ./system; $(MAKE);
# @cd ./integrator; $(MAKE);
@$(AR) $(ARFLAGS) $(FE_LIBRARY) $(DEVELOPER_LIBS)

tidy:
@rm -f Makefile.bak *~ #*# core

clean: tidy
@rm -f *.o

spotless: clean

wipe: spotless
@cd ./element; $(MAKE) wipe;
@cd ./material; $(MAKE) wipe;
# @cd ./recorder; $(MAKE) wipe;
# @cd ./system; $(MAKE) wipe;
# @cd ./integrator; $(MAKE) wipe;

30 changes: 30 additions & 0 deletions DEVELOPER/Makefile.def
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#OS_FLAG = -D_MACOSX
OS_FLAG = -D_LINUX

CC++ = g++
CC = gcc
FC = gfortran

LINKER = $(CC++)
LINKFLAGS = -Wl

CD = cd

C++FLAGS = -O3
CFLAGS = -O2
FFLAGS = -O

INCLUDES = -I../core -I../../core -I../../../core -I../../../../core

.cpp.o:
@$(ECHO) Making $@ from $<
$(CC++) $(C++FLAGS) $(INCLUDES) -c $< -o $@
.C.o:
@$(ECHO) Making $@ from $<
$(CC++) $(C++FLAGS) $(INCLUDES) -c $< -o $@
.c.o:
@$(ECHO) Making $@ from $<
$(CC) $(CFLAGS) -c $< -o $@
.f.o:
@$(ECHO) Making $@ from $<
$(FC) $(FFLAGS) -c $< -o $@
17 changes: 17 additions & 0 deletions DEVELOPER/UnixInstructions.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

for Mac users you need to edit the first part of the Makefile.def, uncomment
the first line and comment or delete the second line!


there are a number of example classes and example scripts to test these
classes. In addition for elements and materials there are example c and
fortran routines.

typing make in the DEVELOPER directory will build them all. the resulting
shared object libraries (dynamic link libraries) will be found in the same
directory as the source code.

to test them you need to ensure that the LD_LIBRARY_PATH is set to include ./

to test them run 'OpenSees example1.tcl', note OpenSees must be on your path.

50 changes: 50 additions & 0 deletions DEVELOPER/WindowsInstructions.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
1. Open ViualStudio
2. File -> New Project
3. Give it name of New class and location of current class files (ElasticPPcpp and C:\???\OpenSeesDeveloper\material (VisualStudio2010 want VisualStudio C++ Win32 - Win32 Project)
4. Select OK (visual Studio20
5. New windows pops up, Select Application Settings
6. Select DLL AND select Empty Project
7. Select Finish

a new project pops up in the workspace with class name (ElasticPPcpp)
8. Right click on source files, select add Existing Item.
9. browse to the class file (should be up 1 directory, select it (elasticPPcpp.cpp)
10.Right click on heared files, select add existing item.
11. browse to header file, select it (elasticPPcpp.h)

12. right click on Project (ElasticPPcpp), select build.

It fails in compilation, as cannot find file elementAPI.h
13. right click on Project (ElasticPPCPP), select Properties.
14. select C/C++ folder icon
15. In Configuration pull down menu, select all configurations
16. Click 3 dots to right of Additional Include Directories
17. In window that pops up, select folder
18. add to line ..\..\core (this directory contains the elementAPI.h file). (keep adding ..\ till it works!)
19. select ok.
20 right click on project (ElasticPPcpp), select build

It fails in Linking, a lot of unresolved external symbols.
21. Right click on source files, select add Existing Item.
22. browse to the core directory (should be 1 directory up)
23. select all the .cpp files here

24. right click on Project (ElasticPPCPP), select build.

IT SHOULD WORK! .. IF IT FAILS GET MY ATTENTION.

Now test it,

25. using windows finder, copy the .dll (C:\??\OpenSeesDeveloper\material\ElasticPPCPP\Debug) into the class directory (C:\???\material\)
26. run OpenSees (2.2.0) (C:\??\OpenSeesDeveloper\bin)
27. cd into directory containing example (cd ..\material)
28. source an example script containing your new command, i.e. type: "source example1.tcl"

If it fails and you are using the x64 bit version you need to change the code generated
30. Under build, choose the configuration manager, you woill see the project marked as win32
31. in the pull down platform menu, choose new, x64 should pop up .. select that
32. build again

IT SHOULD RUN THE SCRIPT! .. IF IT FAILS GET MY ATTENTION.


24 changes: 24 additions & 0 deletions DEVELOPER/element/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
include ../Makefile.def

all:
echo @pwd;
@$(CD) cpp; $(MAKE);
# @$(CD) c; $(MAKE);
# @$(CD) fortran; $(MAKE);

# Miscellaneous
tidy:
@$(RM) $(RMFLAGS) Makefile.bak *~ #*# core

clean: tidy
@$(CD) ./cpp; $(MAKE) wipe;
# @$(CD) ./c; $(MAKE) wipe;
# @$(CD) ./fortran; $(MAKE) wipe;
@$(RM) $(RMFLAGS) $(OBJS) *.o core *.out *.so *.dylib

spotless: clean

wipe: spotless


# DO NOT DELETE THIS LINE -- make depend depends on it.
Loading
Loading