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
7 changes: 7 additions & 0 deletions HACKING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@

This file describes the development process for Shroud.
This includes setting up a development environment, running tests
and creating a release.

# Directory structure

After cloning the repository, the directories will be as follows.
Except for the `build` directory which is created by the Makefile.

build # created by Makefile
sphix # Generated documentation
$tempdir
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ Presentation at FortranCon2020
https://www.youtube.com/watch?v=1mdI-M94vDc
[Slides](./pdf/Shroud-forcon.pdf)

For development processes see the [HACKING](./HACKING.md) file.

## Mailing List

shroud-users@groups.io
Expand Down
24 changes: 24 additions & 0 deletions regression/input/cxxlibrary.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,27 @@ declarations:
function_suffix: _int
- decl: (long length=1)
function_suffix: _long

########################################
# Test overloaded function which return a class pointer,
# uses function_suffix with fortran_generic and
# which also sets function_suffix

- decl: Class1 *getView( const std::string& path )
format:
function_suffix: _from_name
options:
wrap_python: False

- decl: Class1 *getView( const long idx )
format:
function_suffix: _from_index
fortran_generic:
- decl: (int32_t idx)
function_suffix: _int32_t
- decl: (int64_t idx)
function_suffix: _int64_t
options:
wrap_fortran: False
wrap_python: False

4 changes: 3 additions & 1 deletion regression/input/error-ast.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,10 @@ declarations:
fortran_generic:
- decl: (float arg3)
function_suffix: _float
- decl: (double arg3)
- decl: (double arg2, float arg2)
function_suffix: _double
- decl: (doublexx arg2)
function_suffix: _doublexx

# Needed to trigger C_API_case error
- decl: void GoodFunction(void)
Expand Down
3 changes: 3 additions & 0 deletions regression/input/generic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ declarations:
- decl: int SumValues(const int *values+dimension(..), int nvalues)
doxygen:
brief: scalar or array argument using assumed rank
description: |
Create a function for each rank and a generic interface
to call them by one name.
options:
F_assumed_rank_max: 2

Expand Down
3 changes: 2 additions & 1 deletion regression/input/typemap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ declarations:

- decl: bool passIndex(IndexType i1, IndexType *i2+intent(out))
# XXX - This does not act the same as passIndex2.
# It does the type coercision in C++ instead of using a fortran intrinsic.
# It does the type coercision in C++ instead of using a fortran intrinsic
# because of the pointer in *i2.
fortran_generic:
- decl: (int32_t i1)
function_suffix: _32
Expand Down
8 changes: 4 additions & 4 deletions regression/reference/classes/wrapClass1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ CLA_Class1 * CLA_Class1_returnThisBuffer(CLA_Class1 * self, char *name,
SHC_name_cxx, flag);
SHC_rv->addr = SHC_rv_cxx;
SHC_rv->idtor = 0;
SHC_rv->cmemflags = SWIG_MEM_OWN | SWIG_MEM_RVALUE;
SHC_rv->cmemflags = SWIG_MEM_RVALUE;
return SHC_rv;
// splicer end class.Class1.method.returnThisBuffer
}
Expand Down Expand Up @@ -279,7 +279,7 @@ void CLA_Class1_returnThisBuffer_bufferify(CLA_Class1 * self,
SHC_name_cxx, flag);
SHC_rv->addr = SHC_rv_cxx;
SHC_rv->idtor = 0;
SHC_rv->cmemflags = SWIG_MEM_OWN | SWIG_MEM_RVALUE;
SHC_rv->cmemflags = SWIG_MEM_RVALUE;
// splicer end class.Class1.method.returnThisBuffer_bufferify
}
// end CLA_Class1_returnThisBuffer_bufferify
Expand All @@ -301,7 +301,7 @@ CLA_Class1 * CLA_Class1_getclass3(const CLA_Class1 * self,
classes::Class1 *SHC_rv_cxx = SH_this->getclass3();
SHC_rv->addr = SHC_rv_cxx;
SHC_rv->idtor = 0;
SHC_rv->cmemflags = SWIG_MEM_OWN | SWIG_MEM_RVALUE;
SHC_rv->cmemflags = SWIG_MEM_RVALUE;
return SHC_rv;
// splicer end class.Class1.method.getclass3
}
Expand All @@ -324,7 +324,7 @@ void CLA_Class1_getclass3_bufferify(const CLA_Class1 * self,
classes::Class1 *SHC_rv_cxx = SH_this->getclass3();
SHC_rv->addr = SHC_rv_cxx;
SHC_rv->idtor = 0;
SHC_rv->cmemflags = SWIG_MEM_OWN | SWIG_MEM_RVALUE;
SHC_rv->cmemflags = SWIG_MEM_RVALUE;
// splicer end class.Class1.method.getclass3_bufferify
}
// end CLA_Class1_getclass3_bufferify
Expand Down
4 changes: 2 additions & 2 deletions regression/reference/classes/wrapSingleton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ CLA_Singleton * CLA_Singleton_getReference(CLA_Singleton *SHC_rv)
classes::Singleton &SHC_rv_cxx = classes::Singleton::getReference();
SHC_rv->addr = &SHC_rv_cxx;
SHC_rv->idtor = 0;
SHC_rv->cmemflags = SWIG_MEM_OWN | SWIG_MEM_RVALUE;
SHC_rv->cmemflags = SWIG_MEM_RVALUE;
return SHC_rv;
// splicer end class.Singleton.method.getReference
}
Expand All @@ -44,7 +44,7 @@ void CLA_Singleton_getReference_bufferify(CLA_Singleton *SHC_rv)
classes::Singleton &SHC_rv_cxx = classes::Singleton::getReference();
SHC_rv->addr = &SHC_rv_cxx;
SHC_rv->idtor = 0;
SHC_rv->cmemflags = SWIG_MEM_OWN | SWIG_MEM_RVALUE;
SHC_rv->cmemflags = SWIG_MEM_RVALUE;
// splicer end class.Singleton.method.getReference_bufferify
}
// end CLA_Singleton_getReference_bufferify
Expand Down
24 changes: 12 additions & 12 deletions regression/reference/classes/wrapclasses.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ CLA_Class1 * CLA_getclass2(CLA_Class1 *SHC_rv)
const classes::Class1 *SHC_rv_cxx = classes::getclass2();
SHC_rv->addr = const_cast<classes::Class1 *>(SHC_rv_cxx);
SHC_rv->idtor = 0;
SHC_rv->cmemflags = SWIG_MEM_OWN | SWIG_MEM_RVALUE;
SHC_rv->cmemflags = SWIG_MEM_RVALUE;
return SHC_rv;
// splicer end function.getclass2
}
Expand All @@ -140,7 +140,7 @@ void CLA_getclass2_bufferify(CLA_Class1 *SHC_rv)
const classes::Class1 *SHC_rv_cxx = classes::getclass2();
SHC_rv->addr = const_cast<classes::Class1 *>(SHC_rv_cxx);
SHC_rv->idtor = 0;
SHC_rv->cmemflags = SWIG_MEM_OWN | SWIG_MEM_RVALUE;
SHC_rv->cmemflags = SWIG_MEM_RVALUE;
// splicer end function.getclass2_bufferify
}

Expand All @@ -157,7 +157,7 @@ CLA_Class1 * CLA_getclass3(CLA_Class1 *SHC_rv)
classes::Class1 *SHC_rv_cxx = classes::getclass3();
SHC_rv->addr = SHC_rv_cxx;
SHC_rv->idtor = 0;
SHC_rv->cmemflags = SWIG_MEM_OWN | SWIG_MEM_RVALUE;
SHC_rv->cmemflags = SWIG_MEM_RVALUE;
return SHC_rv;
// splicer end function.getclass3
}
Expand All @@ -175,7 +175,7 @@ void CLA_getclass3_bufferify(CLA_Class1 *SHC_rv)
classes::Class1 *SHC_rv_cxx = classes::getclass3();
SHC_rv->addr = SHC_rv_cxx;
SHC_rv->idtor = 0;
SHC_rv->cmemflags = SWIG_MEM_OWN | SWIG_MEM_RVALUE;
SHC_rv->cmemflags = SWIG_MEM_RVALUE;
// splicer end function.getclass3_bufferify
}

Expand All @@ -192,7 +192,7 @@ void CLA_getclass2_void(CLA_Class1 *SHC_rv)
const classes::Class1 *SHC_rv_cxx = classes::getclass2_void();
SHC_rv->addr = const_cast<classes::Class1 *>(SHC_rv_cxx);
SHC_rv->idtor = 0;
SHC_rv->cmemflags = SWIG_MEM_OWN | SWIG_MEM_RVALUE;
SHC_rv->cmemflags = SWIG_MEM_RVALUE;
// splicer end function.getclass2_void
}

Expand All @@ -209,7 +209,7 @@ void CLA_getclass3_void(CLA_Class1 *SHC_rv)
classes::Class1 *SHC_rv_cxx = classes::getclass3_void();
SHC_rv->addr = SHC_rv_cxx;
SHC_rv->idtor = 0;
SHC_rv->cmemflags = SWIG_MEM_OWN | SWIG_MEM_RVALUE;
SHC_rv->cmemflags = SWIG_MEM_RVALUE;
// splicer end function.getclass3_void
}

Expand All @@ -227,7 +227,7 @@ CLA_Class1 * CLA_getConstClassReference(CLA_Class1 *SHC_rv)
);
SHC_rv->addr = const_cast<classes::Class1 *>(&SHC_rv_cxx);
SHC_rv->idtor = 0;
SHC_rv->cmemflags = SWIG_MEM_OWN | SWIG_MEM_RVALUE;
SHC_rv->cmemflags = SWIG_MEM_RVALUE;
return SHC_rv;
// splicer end function.getConstClassReference
}
Expand All @@ -246,7 +246,7 @@ void CLA_getConstClassReference_bufferify(CLA_Class1 *SHC_rv)
);
SHC_rv->addr = const_cast<classes::Class1 *>(&SHC_rv_cxx);
SHC_rv->idtor = 0;
SHC_rv->cmemflags = SWIG_MEM_OWN | SWIG_MEM_RVALUE;
SHC_rv->cmemflags = SWIG_MEM_RVALUE;
// splicer end function.getConstClassReference_bufferify
}

Expand All @@ -259,7 +259,7 @@ CLA_Class1 * CLA_getClassReference(CLA_Class1 *SHC_rv)
classes::Class1 &SHC_rv_cxx = classes::getClassReference();
SHC_rv->addr = &SHC_rv_cxx;
SHC_rv->idtor = 0;
SHC_rv->cmemflags = SWIG_MEM_OWN | SWIG_MEM_RVALUE;
SHC_rv->cmemflags = SWIG_MEM_RVALUE;
return SHC_rv;
// splicer end function.getClassReference
}
Expand All @@ -273,7 +273,7 @@ void CLA_getClassReference_bufferify(CLA_Class1 *SHC_rv)
classes::Class1 &SHC_rv_cxx = classes::getClassReference();
SHC_rv->addr = &SHC_rv_cxx;
SHC_rv->idtor = 0;
SHC_rv->cmemflags = SWIG_MEM_OWN | SWIG_MEM_RVALUE;
SHC_rv->cmemflags = SWIG_MEM_RVALUE;
// splicer end function.getClassReference_bufferify
}

Expand All @@ -296,7 +296,7 @@ CLA_Class1 * CLA_getClass1Copy(int flag, CLA_Class1 *SHC_rv)
*SHC_rv_cxx = classes::getClass1Copy(flag);
SHC_rv->addr = SHC_rv_cxx;
SHC_rv->idtor = 1;
SHC_rv->cmemflags = SWIG_MEM_OWN | SWIG_MEM_RVALUE;
SHC_rv->cmemflags = SWIG_MEM_RVALUE;
return SHC_rv;
// splicer end function.getClass1Copy
}
Expand All @@ -320,7 +320,7 @@ void CLA_getClass1Copy_bufferify(int flag, CLA_Class1 *SHC_rv)
*SHC_rv_cxx = classes::getClass1Copy(flag);
SHC_rv->addr = SHC_rv_cxx;
SHC_rv->idtor = 1;
SHC_rv->cmemflags = SWIG_MEM_OWN | SWIG_MEM_RVALUE;
SHC_rv->cmemflags = SWIG_MEM_RVALUE;
// splicer end function.getClass1Copy_bufferify
}

Expand Down
Loading